Class Backed<T>

java.lang.Object
org.dmfs.jems2.single.Backed<T>
All Implemented Interfaces:
Fragile<T,RuntimeException>, Optional<T>, Single<T>

public final class Backed<T> extends Object implements Single<T>, Optional<T>
Single and Optional that delegates to the given Optional if that is present, otherwise falls back to the provided back-up Single.
  • Constructor Details

  • 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: Single
      Returns the sole value of this 1-tuple.
      Specified by:
      value in interface Fragile<T,RuntimeException>
      Specified by:
      value in interface Optional<T>
      Specified by:
      value in interface Single<T>