Class Present<T>

java.lang.Object
org.dmfs.jems2.optional.Present<T>
All Implemented Interfaces:
Optional<T>

public final class Present<T> extends Object implements Optional<T>
A special Optional that's always present. As a consequence this doesn't take null values.
  • Constructor Details

    • Present

      public Present(T value)
  • Method Details

    • isPresent

      public boolean isPresent()
      Description copied from interface: Optional
      Returns whether the optional value is present.
      Specified by:
      isPresent in interface Optional<T>
    • value

      public T value()
      Description copied from interface: Optional
      Returns the optional value.
      Specified by:
      value in interface Optional<T>