Interface Optionally<T>

Type Parameters:
T - type of the mutable optional object
All Known Implementing Classes:
Optionally.Empty, Optionally.Hard, Optionally.Soft

public interface Optionally<T>
Interface representing a reference to a potentially mutable optional object.
Since:
6.7
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    A permanently empty Optionally
    static class 
    A permanent(hard) reference to an object
    static class 
    A SoftReference Optionally
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Optionally<?>
    The empty Optionally
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the object
    static <T> Optionally<T>
    Get empty Optionally
    Get an Optional representing the current state of the object
  • Field Details

    • EMPTY

      static final Optionally<?> EMPTY
      The empty Optionally
  • Method Details

    • empty

      static <T> Optionally<T> empty()
      Get empty Optionally
      Type Parameters:
      T - type of the empty Optionally
      Returns:
      the empty Optionally
    • clear

      void clear()
      Clear the object
    • getOptional

      Optional<T> getOptional()
      Get an Optional representing the current state of the object
      Returns:
      the mutable optional object