Record Class CollectionChangeSet
java.lang.Object
java.lang.Record
org.hibernate.collection.spi.CollectionChangeSet
@Incubating
public record CollectionChangeSet(List<CollectionChangeSet.Removal> removals, List<CollectionChangeSet.Addition> additions, List<CollectionChangeSet.Shift> shifts, List<CollectionChangeSet.ValueChange> valueChanges)
extends Record
Represents the complete set of changes between a collection's snapshot state
and its current state. Used for planning collection update operations.
- Since:
- 8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents an element that was added to the collection.static final recordRepresents an element that was removed from the collection.static final recordRepresents an element that changed position within the collection.static final recordRepresents an element whose value changed at the same position. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionChangeSet(List<CollectionChangeSet.Removal> removals, List<CollectionChangeSet.Addition> additions, List<CollectionChangeSet.Shift> shifts, List<CollectionChangeSet.ValueChange> valueChanges) Creates an instance of aCollectionChangeSetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()removals()Returns the value of theremovalsrecord component.shifts()Returns the value of theshiftsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueChangesrecord component.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
CollectionChangeSet
public CollectionChangeSet(List<CollectionChangeSet.Removal> removals, List<CollectionChangeSet.Addition> additions, List<CollectionChangeSet.Shift> shifts, List<CollectionChangeSet.ValueChange> valueChanges) Creates an instance of aCollectionChangeSetrecord class.- Parameters:
removals- the value for theremovalsrecord componentadditions- the value for theadditionsrecord componentshifts- the value for theshiftsrecord componentvalueChanges- the value for thevalueChangesrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
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). -
removals
Returns the value of theremovalsrecord component.- Returns:
- the value of the
removalsrecord component
-
additions
Returns the value of theadditionsrecord component.- Returns:
- the value of the
additionsrecord component
-
shifts
Returns the value of theshiftsrecord component.- Returns:
- the value of the
shiftsrecord component
-
valueChanges
Returns the value of thevalueChangesrecord component.- Returns:
- the value of the
valueChangesrecord component
-