Class Maybe<T>


  • public final class Maybe<T>
    extends Object
    The Maybe encapsulates an optional value. An object of type Maybe<T> either contains a value of type T (created by just(value)) or it is empty (created by nothing()). TODO: Replace with java.util.Optional or get rid of boolean field
    Author:
    dmitry.neverov
    • Method Detail

      • get

        public T get()
      • isNothing

        public boolean isNothing()
      • isJust

        public boolean isJust()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • just

        public static <T> Maybe<T> just​(T value)
      • nothing

        public static <T> Maybe<T> nothing()