-
- Type Parameters:
V
- type of thevalue
.
- All Superinterfaces:
Supplier<V>
- All Known Subinterfaces:
PropertyPath<V>
,ReadableTypedValue<V>
,TypedPropertyPath<V>
,WritableValue<V>
public interface ReadableValue<V> extends Supplier<V>
This interface gives read access to thevalue
of an object.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description V
get()
static <T> T
get(ReadableValue<T> value)
Null-safe access toget()
.V
getSafe()
-
-
-
Method Detail
-
get
V get()
-
getSafe
V getSafe()
- Returns:
- the same as
get()
but trying to avoid returningnull
where possible. So a neutral element is returned instead ofnull
for each type supporting this (e.g. "" forString
,0
for any kind ofNumber
,Boolean.FALSE
, empty collection, etc.).
-
get
static <T> T get(ReadableValue<T> value)
Null-safe access toget()
.- Type Parameters:
T
- type of thevalue
- Parameters:
value
- theReadableValue
to unwrap.- Returns:
- the
value
of theReadableValue
. Will benull
if the givenReadableValue
isnull
or itsvalue
isnull
.
-
-