E
- The type of element within the listM
- The type of DataManipulator
I
- The type of ImmutableDataManipulator
public abstract class AbstractListData<E,M extends ListData<E,M,I>,I extends ImmutableListData<E,I,M>> extends AbstractSingleData<List<E>,M,I> implements ListData<E,M,I>
ListData
s provided by the API.defaultValue, usedKey, value
Modifier | Constructor and Description |
---|---|
protected |
AbstractListData(Key<ListValue<E>> usedKey,
List<E> value) |
protected |
AbstractListData(Key<ListValue<E>> usedKey,
List<E> value,
List<E> defaultValue) |
protected |
AbstractListData(List<E> value,
Key<? extends BaseValue<List<E>>> usedKey)
Deprecated.
Use
AbstractListData(Key, List) instead. |
Modifier and Type | Method and Description |
---|---|
abstract I |
asImmutable()
Gets an
ImmutableDataManipulator copy of this
DataManipulator such that all backed Value s are copied
into ImmutableValue counterparts. |
List<E> |
asList()
Gets the
List value itself from this manipulator. |
boolean |
equals(Object obj) |
<V> Optional<V> |
get(Key<? extends BaseValue<V>> key)
|
ListValue<E> |
getListValue()
|
protected List<E> |
getValue()
A simple getter for usage with a
Supplier for
the AbstractData.registerFieldGetter(Key, Supplier) method. |
protected ListValue<E> |
getValueGetter()
Gets the
Value as a method since this manipulator only focuses
on a single value. |
int |
hashCode() |
protected M |
setValue(List<E> value)
A simple setter for usage with a
Consumer for
the AbstractData.registerFieldSetter(Key, Consumer) method. |
boolean |
supports(Key<?> key)
Checks if the given
Key is supported by this
ValueContainer . |
fillContainer, registerGettersAndSetters
getKeys, getValue, getValues, registerFieldGetter, registerFieldSetter, registerKeyValue, set, toContainer, transform
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addElement, addElement, addElements, contains, get, remove, remove, removeAll, removeAll, setElement, setElements
copy, fill, fill, from, set, set, set, set, transform
getContentVersion, toContainer
@Deprecated protected AbstractListData(List<E> value, Key<? extends BaseValue<List<E>>> usedKey)
AbstractListData(Key, List)
instead.protected ListValue<E> getValueGetter()
AbstractSingleData
Value
as a method since this manipulator only focuses
on a single value.getValueGetter
in class AbstractSingleData<List<E>,M extends ListData<E,M,I>,I extends ImmutableListData<E,I,M>>
public <V> Optional<V> get(Key<? extends BaseValue<V>> key)
ValueContainer
BaseValue
linked to the provided Key
. If the Key
is not
supported, Optional.empty()
is returned. It is important
to check for support of a Key
by either calling
ValueContainer.supports(BaseValue)
or ValueContainer.supports(Key)
.public boolean supports(Key<?> key)
ValueContainer
Key
is supported by this
ValueContainer
.public abstract I asImmutable()
DataManipulator
ImmutableDataManipulator
copy of this
DataManipulator
such that all backed Value
s are copied
into ImmutableValue
counterparts. Any changes to this
DataManipulator
will NOT be reflected on the returned
ImmutableDataManipulator
and vice versa.asImmutable
in interface DataManipulator<M extends ListData<E,M,I>,I extends ImmutableListData<E,I,M>>
asImmutable
in class AbstractSingleData<List<E>,M extends ListData<E,M,I>,I extends ImmutableListData<E,I,M>>
DataManipulator
's data copied into a
ImmutableDataManipulator
protected List<E> getValue()
AbstractSingleData
Supplier
for
the AbstractData.registerFieldGetter(Key, Supplier)
method.protected M setValue(List<E> value)
AbstractSingleData
Consumer
for
the AbstractData.registerFieldSetter(Key, Consumer)
method.public int hashCode()
public boolean equals(Object obj)