Package page.codeberg.friedolyn.util
Record Class Changes<Type>
java.lang.Object
java.lang.Record
page.codeberg.friedolyn.util.Changes<Type>
- Type Parameters:
Type- The class of the object that has changed.- Record Components:
oldVersion- Contains those fields of the old version that have changed in thenewVersion().newVersion- Contains those fields of the new version that have changed in theoldVersion().unchanged- Contains those fields that are the same in both versions.
Represents updates between two versions of an object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeThe field for thenewVersionrecord component.private final TypeThe field for theoldVersionrecord component.private final TypeThe field for theunchangedrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenewVersionrecord component.Returns the value of theoldVersionrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunchangedrecord component.
-
Field Details
-
oldVersion
The field for theoldVersionrecord component. -
newVersion
The field for thenewVersionrecord component. -
unchanged
-
-
Constructor Details
-
Changes
Creates an instance of aChangesrecord class.- Parameters:
oldVersion- the value for theoldVersionrecord componentnewVersion- the value for thenewVersionrecord componentunchanged- the value for theunchangedrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
oldVersion
Returns the value of theoldVersionrecord component.- Returns:
- the value of the
oldVersionrecord component
-
newVersion
Returns the value of thenewVersionrecord component.- Returns:
- the value of the
newVersionrecord component
-
unchanged
-