Interface ValueObserver<T>

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>
All Known Implementing Classes:
AbstractComponentValue, AbstractTextComponentValue, AbstractValue

public interface ValueObserver<T> extends EventObserver<T>, Supplier<T>
A read only value observer
  • Method Details

    • optional

      default Optional<T> 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
    • 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
    • notEqualTo

      default boolean notEqualTo(T value)
      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