Class Optional<T>

    • Method Detail

      • orElse

        public T orElse​(T elseVal)
      • none

        public static <T> Optional<T> none()
        Produce empty Option
        Type Parameters:
        T - type
        Returns:
        empty option
      • of

        public static <T> Optional<T> of​(T val)
        Wrap the existing value in Option.
        Type Parameters:
        T - type
        Parameters:
        val - value to wrap
        Returns:
        option with value
      • eitherOf

        public static <T> Optional<T> eitherOf​(T val)
      • hasValue

        public boolean hasValue()
      • get

        public T get()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object