Package org.spongepowered.api.data.value
Interface ListValue.Immutable<E>
- 
- Type Parameters:
- E- The type of element of this list value
 - All Superinterfaces:
- CollectionValue<E,List<E>>,- CollectionValue.Immutable<E,List<E>,ListValue.Immutable<E>,ListValue.Mutable<E>>,- Iterable<E>,- ListValue<E>,- Value<List<E>>,- Value.Immutable<List<E>>
 
 public static interface ListValue.Immutable<E> extends ListValue<E>, CollectionValue.Immutable<E,List<E>,ListValue.Immutable<E>,ListValue.Mutable<E>> A type ofCollectionValue.Immutablethat is backed by aList. All "with" and "Without" methods are returning new instances as every instance is immutable.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.value.CollectionValueCollectionValue.Immutable<E,C extends Collection<E>,I extends CollectionValue.Immutable<E,C,I,M>,M extends CollectionValue.Mutable<E,C,M,I>>, CollectionValue.Mutable<E,C extends Collection<E>,M extends CollectionValue.Mutable<E,C,M,I>,I extends CollectionValue.Immutable<E,C,I,M>>
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.value.ListValueListValue.Immutable<E>, ListValue.Mutable<E>
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.value.ValueValue.Factory, Value.Immutable<E>, Value.Mutable<E>
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ListValue.Immutable<E>asImmutable()Retrieves an immutable form of this value.ListValue.Mutable<E>asMutable()Retrieves a mutable form of this value.ListValue.Immutable<E>set(int index, E element)Creates a newListValue.Immutablewith the desired element at the desired index.ListValue.Immutable<E>with(int index, E value)Creates a newListValue.Immutablewith the specified element at the specified position in the list.ListValue.Immutable<E>with(int index, Iterable<E> values)Creates a newListValue.Immutablewith the specified elements in the order that they are iterated to the list at the specified index.ListValue.Immutable<E>without(int index)Creates a newListValue.Immutablewithout the element at the specified index.- 
Methods inherited from interface org.spongepowered.api.data.value.CollectionValueall, asMutableCopy, contains, containsAll, isEmpty, size
 - 
Methods inherited from interface org.spongepowered.api.data.value.CollectionValue.ImmutableasMutableCopy, transform, with, withAll, withElement, without, withoutAll, withoutAll
 - 
Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
 
- 
 
- 
- 
- 
Method Detail- 
withListValue.Immutable<E> with(int index, E value) Creates a newListValue.Immutablewith the specified element at the specified position in the list. As well, the element at the provided index is shifted to the right, increasing its and the elements thereafter their indices by one.- Parameters:
- index- The index to add the provided element at
- value- The element to add
- Returns:
- The new value, for chaining
 
 - 
withListValue.Immutable<E> with(int index, Iterable<E> values) Creates a newListValue.Immutablewith the specified elements in the order that they are iterated to the list at the specified index. The element at the provided index and elements thereafter are shifted to the right, increasing their indices by one.- Parameters:
- index- The index to add the elements at
- values- The elements to add
- Returns:
- The new value, for chaining
 
 - 
withoutListValue.Immutable<E> without(int index) Creates a newListValue.Immutablewithout the element at the specified index. Shifts any subsequent elements to the left, subtracts one from their indices.- Parameters:
- index- The index of the element to exclude
- Returns:
- The new value, for chaining
 
 - 
setListValue.Immutable<E> set(int index, E element) Creates a newListValue.Immutablewith the desired element at the desired index.- Parameters:
- index- The index to replace the element
- element- The element to include at the index
- Returns:
- The new value, for chaining
 
 - 
asMutableListValue.Mutable<E> asMutable() Description copied from interface:ValueRetrieves a mutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Mutableinstance where this would simply return itself. In other cases, where the retrieved value is anValue.Immutableinstance, a new mutable value is created with the same key and values.- Specified by:
- asMutablein interface- CollectionValue<E,List<E>>
- Specified by:
- asMutablein interface- CollectionValue.Immutable<E,List<E>,ListValue.Immutable<E>,ListValue.Mutable<E>>
- Specified by:
- asMutablein interface- ListValue<E>
- Specified by:
- asMutablein interface- Value<E>
- Specified by:
- asMutablein interface- Value.Immutable<E>
- Returns:
- A mutable value
 
 - 
asImmutabledefault ListValue.Immutable<E> asImmutable() Description copied from interface:ValueRetrieves an immutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Immutableinstance where this would simply return itself. In other cases, where the retrieved value is aValue.Mutableinstance, a new immutable value is created with the same key and values.- Specified by:
- asImmutablein interface- CollectionValue<E,List<E>>
- Specified by:
- asImmutablein interface- CollectionValue.Immutable<E,List<E>,ListValue.Immutable<E>,ListValue.Mutable<E>>
- Specified by:
- asImmutablein interface- ListValue<E>
- Specified by:
- asImmutablein interface- Value<E>
- Specified by:
- asImmutablein interface- Value.Immutable<E>
- Returns:
- An immutable value
 
 
- 
 
-