V
- The type of the items of this nd-array.public static interface Nda.Item<V>
Nda.at(int...)
method,
and they allow you to get individual nd-array itemsModifier and Type | Method and Description |
---|---|
default boolean |
doesNotExist() |
default boolean |
exists() |
default V |
get()
Get the value at the targeted position or throw an exception if the item does not exist.
|
default java.util.Optional<V> |
map(java.util.function.Function<V,V> mapper)
Maps this item to an optional value based on the provided lambda.
|
default V |
orElse(V defaultValue)
Get the value at the targeted position or return the provided default value if the item does not exist.
|
V |
orElseNull()
Get the value at the targeted position or return
null if the item does not exist. |
default java.util.Optional<V> |
toOptional()
Converts this item into an optional value.
|
default V get()
default V orElse(V defaultValue)
defaultValue
- The default value to return if the item does not exist.java.lang.IllegalArgumentException
- If the provided default value is null
.V orElseNull()
null
if the item does not exist.null
.default java.util.Optional<V> toOptional()
default java.util.Optional<V> map(java.util.function.Function<V,V> mapper)
null
the resulting optional will be empty.
Otherwise, the resulting optional will contain the value returned by the lambda.mapper
- The lambda which maps the item to an optional value.default boolean exists()
true
if the item exists, false
otherwise.default boolean doesNotExist()
true
if the item does not exist, false
otherwise.