T
- container typepublic interface OnEmpty<T>
Modifier and Type | Method and Description |
---|---|
OnEmpty<T> |
onEmpty(T value)
If this Container instance is zero, create a new instance containing the provided value
|
OnEmpty<T> |
onEmptyGet(java.util.function.Supplier<? extends T> supplier)
If this Container instance is zero, create a new instance containing the value returned from the provided Supplier
|
<X extends java.lang.Throwable> |
onEmptyThrow(java.util.function.Supplier<? extends X> supplier)
If this container instance is zero, throw the exception returned by the provided Supplier
|
OnEmpty<T> onEmpty(T value)
value
- OnEmpty<T> onEmptyGet(java.util.function.Supplier<? extends T> supplier)
supplier
- to determine new value for container<X extends java.lang.Throwable> OnEmpty<T> onEmptyThrow(java.util.function.Supplier<? extends X> supplier)
supplier
- to create exception from