-
- 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 thevalueof an object.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Vget()static <T> Tget(ReadableValue<T> value)Null-safe access toget().VgetSafe()
-
-
-
Method Detail
-
get
V get()
-
getSafe
V getSafe()
- Returns:
- the same as
get()but trying to avoid returningnullwhere possible. So a neutral element is returned instead ofnullfor each type supporting this (e.g. "" forString,0for 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- theReadableValueto unwrap.- Returns:
- the
valueof theReadableValue. Will benullif the givenReadableValueisnullor itsvalueisnull.
-
-