public interface ListData<E,M extends ListData<E,M,I>,I extends ImmutableListData<E,I,M>> extends DataManipulator<M,I>
Modifier and Type | Method and Description |
---|---|
default M |
addElement(E element)
Appends the provided element at the end of the underlying
List . |
default M |
addElement(int index,
E element)
Inserts the specified element at the specified position in this list.
|
default M |
addElements(Iterable<E> elements)
Appends the provided
E elements to the end of the internal list
of elements. |
List<E> |
asList()
Gets the
List value itself from this manipulator. |
default boolean |
contains(E element)
Returns whether the underlying
List contains the provided
element . |
default Optional<E> |
get(int index)
Gets an element of type
E by the provided index . |
ListValue<E> |
getListValue()
|
default M |
remove(E element)
Removes the desired
element from the underlying List . |
default M |
remove(int index)
Removes the desired
element from the desired index . |
default M |
removeAll(Iterable<E> elements)
Removes all of the provided
elements from the underlying
List . |
default M |
removeAll(Predicate<E> predicate)
|
default M |
setElement(int index,
E element)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
default M |
setElements(List<E> elements)
Replaces the underlying list of elements with the provided
List
of elements. |
asImmutable, copy, fill, fill, from, set, set, set, set, transform
getContentVersion, toContainer
List<E> asList()
List
value itself from this manipulator.ListValue
default Optional<E> get(int index)
E
by the provided index
.index
- The index to get the value atList.get(int)
default boolean contains(E element)
List
contains the provided
element
.element
- The element to checkList.contains(Object)
default M setElement(int index, E element)
index
- The index to set the element toelement
- The element to set at the indexList.set(int, Object)
default M setElements(List<E> elements)
List
of elements.elements
- The element to set at the indexList.set(int, Object)
default M addElement(E element)
List
.element
- The element to appendList.add(Object)
default M addElement(int index, E element)
index
- The index of the elementelement
- The element to addList.add(int, Object)
default M addElements(Iterable<E> elements)
E
elements to the end of the internal list
of elements.elements
- The elements to addList.addAll(Collection)
default M remove(int index)
element
from the desired index
.index
- The index to remove an element fromList.remove(int)
default M remove(E element)
element
from the underlying List
.element
- The element to removeList.remove(Object)
default M removeAll(Iterable<E> elements)
elements
from the underlying
List
.elements
- The elements to removeList.removeAll(Collection)
default M removeAll(Predicate<E> predicate)
predicate
- The predicate to filter elements fromCollection.removeIf(Predicate)