java.lang.Object
de.linusdev.data.container.NonExistentListContainer<T>
- All Implemented Interfaces:
ListContainer<T>,OptionalValue<List<T>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C> @NotNull ListContainer<C>cast()Casts each element of the list toListContainer.<C,R> @NotNull ListContainer<R> castAndConvert(@NotNull Converter<C, R> converter) Casts each element of the list toListContainerand then converts it with given converter.<C,R, E extends Throwable>
@NotNull ListContainer<R>castAndConvertWithException(@NotNull ExceptionConverter<C, R, E> converter) Casts each element of the list toListContainerand then converts it with given converter.<N> @NotNull ListContainer<N>Creates a newcontainerwith given value.booleanexists()get()The actual value of classOptionalValuerepresented by thisOptionalValue.booleanisNull()@NotNull ListContainer<T>Process this container's list with givenConsumer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.linusdev.data.OptionalValue
getAs
-
Constructor Details
-
NonExistentListContainer
public NonExistentListContainer()
-
-
Method Details
-
get
Description copied from interface:OptionalValueThe actual value of classOptionalValuerepresented by thisOptionalValue.- Specified by:
getin interfaceOptionalValue<T>- Returns:
OptionalValueornull
-
isNull
public boolean isNull()- Specified by:
isNullin interfaceOptionalValue<T>- Returns:
trueifOptionalValue.get()will returnnull.
-
exists
public boolean exists()Description copied from interface:OptionalValue- Specified by:
existsin interfaceOptionalValue<T>- Returns:
trueif thisOptionalValueexists in theAbstractDatathisOptionalValueis of.
-
createNew
Description copied from interface:ListContainerCreates a newcontainerwith given value.- Specified by:
createNewin interfaceListContainer<T>- Type Parameters:
N- the new value type.- Parameters:
newValue- the value for the new container- Returns:
- a new
ListContainer.
-
castAndConvert
@NotNull public <C,R> @NotNull ListContainer<R> castAndConvert(@NotNull @NotNull Converter<C, R> converter) Description copied from interface:ListContainerCasts each element of the list toListContainerand then converts it with given converter.- Specified by:
castAndConvertin interfaceListContainer<T>- Type Parameters:
C- type to cast to.R- type to convert to.- Parameters:
converter-Containerto convert fromListContainertoListContainer.- Returns:
- a new
ListContainercontaining theListofListContainer.
-
castAndConvertWithException
@NotNull public <C,R, @NotNull ListContainer<R> castAndConvertWithExceptionE extends Throwable> (@NotNull @NotNull ExceptionConverter<C, R, E> converter) Description copied from interface:ListContainerCasts each element of the list toListContainerand then converts it with given converter.- Specified by:
castAndConvertWithExceptionin interfaceListContainer<T>- Type Parameters:
C- type to cast to.R- type to convert to.E- exception type of yourExceptionConverter.- Parameters:
converter-Containerto convert fromListContainertoListContainer.- Returns:
- a new
ListContainercontaining theListofListContainer.
-
cast
Description copied from interface:ListContainerCasts each element of the list toListContainer.- Specified by:
castin interfaceListContainer<T>- Type Parameters:
C- the type to cast to.- Returns:
- a new
ListContainercontaining theListofListContainer.
-
process
Description copied from interface:ListContainerProcess this container's list with givenConsumer.- Specified by:
processin interfaceListContainer<T>- Parameters:
consumer- to consume this list.- Returns:
- this
-