java.lang.Object
de.linusdev.data.container.ContainerImpl<K,V,O>
- All Implemented Interfaces:
Container<K,,V, O> OptionalValue<O>
-
Constructor Summary
ConstructorsConstructorDescriptionContainerImpl(@NotNull AbstractData<K, V> parentData, K key, O value, boolean exists) -
Method Summary
Modifier and TypeMethodDescriptioncreateNewContainer(N newValue) Creates a newContainerwith given value.<T> @NotNull ListContainer<T>createNewListContainer(@Nullable List<T> newValue) Creates a newListContainerwith given value.booleanexists()get()The actual value of classOptionalValuerepresented by thisOptionalValue.getKey()@NotNull AbstractData<K,V> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.linusdev.data.container.Container
asList, cast, castAndConvert, castAndConvertWithException, ifExists, process, requireNotNull, requireNotNullMethods inherited from interface de.linusdev.data.OptionalValue
getAs, isNull
-
Constructor Details
-
ContainerImpl
@Contract(pure=true) public ContainerImpl(@NotNull @NotNull AbstractData<K, V> parentData, @NotNull K key, @Nullable O value, boolean exists)
-
-
Method Details
-
get
Description copied from interface:OptionalValueThe actual value of classOptionalValuerepresented by thisOptionalValue.- Specified by:
getin interfaceOptionalValue<K>- Returns:
OptionalValueornull
-
exists
public boolean exists()Description copied from interface:OptionalValue- Specified by:
existsin interfaceOptionalValue<K>- Returns:
trueif thisOptionalValueexists in theAbstractDatathisOptionalValueis of.
-
getKey
-
getParentData
- Specified by:
getParentDatain interfaceContainer<K,V, O> - Returns:
parent data.
-
createNewContainer
Description copied from interface:ContainerCreates a newContainerwith given value. -
createNewListContainer
@NotNull public <T> @NotNull ListContainer<T> createNewListContainer(@Nullable @Nullable List<T> newValue) Description copied from interface:ContainerCreates a newListContainerwith given value.- Specified by:
createNewListContainerin interfaceContainer<K,V, O> - Type Parameters:
T- the list-element type- Parameters:
newValue- the list value- Returns:
- a new
ListContainer
-