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 Type
The field for thenewVersion
record component.private final Type
The field for theoldVersion
record component.private final Type
The field for theunchanged
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenewVersion
record component.Returns the value of theoldVersion
record component.final String
toString()
Returns a string representation of this record class.Returns the value of theunchanged
record component.
-
Field Details
-
oldVersion
The field for theoldVersion
record component. -
newVersion
The field for thenewVersion
record component. -
unchanged
-
-
Constructor Details
-
Changes
Creates an instance of aChanges
record class.- Parameters:
oldVersion
- the value for theoldVersion
record componentnewVersion
- the value for thenewVersion
record componentunchanged
- the value for theunchanged
record 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 theoldVersion
record component.- Returns:
- the value of the
oldVersion
record component
-
newVersion
Returns the value of thenewVersion
record component.- Returns:
- the value of the
newVersion
record component
-
unchanged
-