Record Class ItemDragging.ItemMove
java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.control.attribute.item.ItemDragging.ItemMove
- Record Components:
indexes- the rows' indexes in the items before the move, ascending and without repeats, never emptybefore- the index, in the items before the move, of the row the moved rows go in front of, or the number of items to put them at the end
- Enclosing interface:
ItemDragging<T, S extends ItemDragging<T,S>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> List<T> Returns the items after this move.intbefore()Returns the value of thebeforerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.indexes()Returns the value of theindexesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemMove
Checks and copies the indexes.- Parameters:
indexes- the rows' indexes, ascending and without repeats, never emptybefore- where they go- Throws:
IllegalArgumentException- if the indexes are empty, not ascending, repeat or are negative, orbeforeis negative
-
-
Method Details
-
apply
Returns the items after this move.- Type Parameters:
T- the type of the items- Parameters:
items- the items before- Returns:
- a new list with the moved items in front of
before, in their order - Throws:
IndexOutOfBoundsException- if an index is not an item's, orbeforeis past the end
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
indexes
-
before
-