Package com.vaadin.flow.signals.shared
Record Class SharedListSignal.ListPosition
java.lang.Object
java.lang.Record
com.vaadin.flow.signals.shared.SharedListSignal.ListPosition
- Record Components:
after- id of the node to insert immediately after, ornullto not define a constraintbefore- id of the node to insert immediately before, ornullto not define a constraint
- Enclosing class:
SharedListSignal<T extends @Nullable Object>
public static record SharedListSignal.ListPosition(@Nullable Id after, @Nullable Id before)
extends Record
A list insertion position before and/or after the referenced entries. If
both entries are defined, then this position represents an exact match
that is valid only if the two entries are adjacent. If only one is
defined, then the position is relative to only that position. A position
with neither reference is not valid for inserts but it is valid to test a
parent-child relationship regardless of the child position.
Id.ZERO represents the edge of the list, i.e. the first or the
last position.-
Constructor Summary
ConstructorsConstructorDescriptionListPosition(@Nullable Id after, @Nullable Id before) Creates an instance of aListPositionrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Idafter()Returns the value of theafterrecord component.after(@Nullable AbstractSignal<?> after) Gets the insertion position immediately after the given signal.@Nullable Idbefore()Returns the value of thebeforerecord component.before(@Nullable AbstractSignal<?> before) Gets the insertion position immediately before the given signal.between(@Nullable AbstractSignal<?> after, @Nullable AbstractSignal<?> before) Gets the insertion position between the given signals, assuming those signals are currently adjacent.final booleanIndicates whether some other object is "equal to" this one.first()Gets the insertion position that corresponds to the beginning of the list.final inthashCode()Returns a hash code value for this object.last()Gets the insertion position that corresponds to the end of the list.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
first
Gets the insertion position that corresponds to the beginning of the list.- Returns:
- a list position for the beginning of the list, not
null
-
last
Gets the insertion position that corresponds to the end of the list.- Returns:
- a list position for the end of the list, not
null
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
after
Returns the value of theafterrecord component.- Returns:
- the value of the
afterrecord component
-
before
Returns the value of thebeforerecord component.- Returns:
- the value of the
beforerecord component
-