Interface Opt<T>

  • Type Parameters:
    T - Type of item
    All Known Implementing Classes:
    Opt.Empty, Opt.Single

    public interface Opt<T>
    Replacement a nullable T reference with a non-null value.

    All implementations of this interface must be immutable and thread-safe.

    Since:
    0.14
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Opt.Empty<T>
      Empty instance.
      static class  Opt.Single<T>
      Holder for a single element only.
    • Method Detail

      • get

        T get()
        Returns the contained instance.
        Returns:
        Instance
      • has

        boolean has()
        Returns true if contains instance.
        Returns:
        True if present