Package com.vaadin.signals
Record Class ListSignal.ListPosition
java.lang.Object
java.lang.Record
com.vaadin.signals.ListSignal.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:
- ListSignal<T>
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(Id after, Id before) Creates an instance of aListPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionafter()Returns the value of theafterrecord component.static ListSignal.ListPositionafter(AbstractSignal<?> after) Gets the insertion position immediately after the given signal.before()Returns the value of thebeforerecord component.static ListSignal.ListPositionbefore(AbstractSignal<?> before) Gets the insertion position immediately before the given signal.static ListSignal.ListPositionbetween(AbstractSignal<?> after, 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.static ListSignal.ListPositionfirst()Gets the insertion position that corresponds to the beginning of the list.final inthashCode()Returns a hash code value for this object.static ListSignal.ListPositionlast()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
-
after
Gets the insertion position immediately after the given signal. Inserting afternullis interpreted as inserting after the start of the list, i.e. as the first child.- Parameters:
after- the signal to insert after, ornullto insert first- Returns:
- a list position after the given signal, not
null
-
before
Gets the insertion position immediately before the given signal. Inserting beforenullsignal is interpreted as inserting before the end of the list, i.e. as the last child.- Parameters:
before- the signal to insert before, ornullto insert last- Returns:
- a list position after the given signal, not
null
-
between
Gets the insertion position between the given signals, assuming those signals are currently adjacent. Inserting afternullis interpreted as inserting after the start of the list, i.e. as the first child. Inserting beforenullsignal is interpreted as inserting before the end of the list, i.e. as the last child.- Parameters:
after- the signal to insert after, ornullto insert firstbefore- the signal to insert before, ornullto insert last- Returns:
- a list position between the given signals, 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
-