- 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
,Value<T>
,ValueSet<T>
,ValueSetObserver<T>
- All Known Implementing Classes:
AbstractComponentValue
,AbstractTextComponentValue
,AbstractValue
A read only value observer
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns true if the underlying value is equal to the given one.default boolean
isNotEqualTo
(T value) Returns true if the underlying value is NOT equal to the given one.default boolean
default boolean
isNull()
boolean
nullable()
If false then get() is guaranteed to never return null.optional()
Methods inherited from interface is.codion.common.event.EventObserver
addConsumer, addListener, addWeakConsumer, addWeakListener, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
-
Method Details
-
optional
- Returns:
- an
Optional
wrapping this value.
-
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.
-
nullable
boolean nullable()If false then get() is guaranteed to never return null.- Returns:
- true if this value can be null
-
isEqualTo
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
-
isNotEqualTo
Returns true if the underlying value is NOT equal to the given one. Note that null == null.- Parameters:
value
- the value- Returns:
- true if the underlying value is NOT equal to the given one
-