-
- Type Parameters:
T
- the type of the value
- All Superinterfaces:
EventObserver<T>
,Supplier<T>
- All Known Subinterfaces:
ComponentValue<T,C>
,PropertyValue<T>
,State
,State.Combination
,StateObserver
,StringValue<T>
,Value<T>
,ValueSet<T>
- All Known Implementing Classes:
AbstractComponentValue
,AbstractTextComponentValue
,AbstractValue
public interface ValueObserver<T> extends EventObserver<T>, Supplier<T>
A read only value observer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
equalTo(T value)
Returns true if the underlying value is equal to the given one.default boolean
isNotNull()
default boolean
isNull()
boolean
isNullable()
If false then get() is guaranteed to never return null.default Optional<T>
toOptional()
-
Methods inherited from interface is.codion.common.event.EventObserver
addDataListener, addListener, removeDataListener, removeListener
-
-
-
-
Method Detail
-
isNull
default boolean isNull()
- Returns:
- true if the underlying value is null.
-
isNotNull
default boolean isNotNull()
- Returns:
- true if the underlying value is not null.
-
isNullable
boolean isNullable()
If false then get() is guaranteed to never return null.- Returns:
- true if this value can be null
-
equalTo
default boolean equalTo(T value)
Returns true if the underlying value is equal to the given one. Note that null == null.- Parameters:
value
- the value- Returns:
- true if the underlying value is equal to the given one
-
-