Class SettableOptional<T>


  • public final class SettableOptional<T>
    extends java.lang.Object
    An optional which contains a settable value
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      SettableOptional()
      Creates a new empty settable optional
      SettableOptional​(java.util.Optional<T> value)
      Creates a new settable optional with the given value, or an empty
      SettableOptional​(T value)
      Creates a new settable optional with the given value
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<T> asOptional()  
      T get()  
      boolean isPresent()  
      void set​(java.util.Optional<T> value)  
      void set​(T value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SettableOptional

        public SettableOptional()
        Creates a new empty settable optional
      • SettableOptional

        public SettableOptional​(T value)
        Creates a new settable optional with the given value
      • SettableOptional

        public SettableOptional​(java.util.Optional<T> value)
        Creates a new settable optional with the given value, or an empty
    • Method Detail

      • isPresent

        public boolean isPresent()
      • get

        public T get()
      • set

        public void set​(T value)
      • set

        public void set​(java.util.Optional<T> value)
      • asOptional

        public java.util.Optional<T> asOptional()