Class Mapped<From,​To>

  • All Implemented Interfaces:
    Optional<To>

    public final class Mapped<From,​To>
    extends java.lang.Object
    implements Optional<To>
    Optional that maps an Optional if it's present using the given Function.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isPresent()
      Returns whether the optional value is present.
      To value()
      Returns the optional value.
      • Methods inherited from class java.lang.Object

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

      • isPresent

        public boolean isPresent()
        Description copied from interface: Optional
        Returns whether the optional value is present.
        Specified by:
        isPresent in interface Optional<From>
      • value

        public To value()
                 throws java.util.NoSuchElementException
        Description copied from interface: Optional
        Returns the optional value.
        Specified by:
        value in interface Optional<From>
        Throws:
        java.util.NoSuchElementException - if the optional value is not present.