Package akka.japi

Class Option<A>

  • All Implemented Interfaces:
    java.lang.Iterable<A>
    Direct Known Subclasses:
    Option.Some

    public abstract class Option<A>
    extends java.lang.Object
    implements java.lang.Iterable<A>
    This class represents optional values. Instances of Option are either instances of case class Some or it is case object None.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Option.Some<A>
      Class Some[A] represents existing values of type A.
      static class  Option.Some$  
    • Constructor Summary

      Constructors 
      Constructor Description
      Option()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract scala.Option<A> asScala()  
      static void forEach​(java.util.function.Consumer<? super T> x$1)  
      static <T> Option<T> fromScalaOption​(scala.Option<T> scalaOption)
      Converts a Scala Option to a Java Option
      abstract A get()  
      abstract <B> B getOrElse​(B defaultValue)
      Returns a if this is some(a) or defaultValue if this is none.
      boolean isDefined()  
      abstract boolean isEmpty()  
      java.util.Iterator<A> iterator()  
      static <A> scala.Option<A> java2ScalaOption​(Option<A> o)  
      static <A> Option<A> none()
      Option factory that creates None
      static <A> Option<A> option​(A v)
      Option factory that creates None if v is null, Some(v) otherwise.
      static <A> Option<A> scala2JavaOption​(scala.Option<A> o)  
      static <A> Option<A> some​(A v)
      Option factory that creates Some
      static java.util.Spliterator<T> spliterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Option

        public Option()
    • Method Detail

      • some

        public static <A> Option<A> some​(A v)
        Option factory that creates Some
        Parameters:
        v - (undocumented)
        Returns:
        (undocumented)
      • none

        public static <A> Option<A> none()
        Option factory that creates None
        Returns:
        (undocumented)
      • option

        public static <A> Option<A> option​(A v)
        Option factory that creates None if v is null, Some(v) otherwise.
        Parameters:
        v - (undocumented)
        Returns:
        (undocumented)
      • fromScalaOption

        public static <T> Option<T> fromScalaOption​(scala.Option<T> scalaOption)
        Converts a Scala Option to a Java Option
        Parameters:
        scalaOption - (undocumented)
        Returns:
        (undocumented)
      • java2ScalaOption

        public static <A> scala.Option<A> java2ScalaOption​(Option<A> o)
      • scala2JavaOption

        public static <A> Option<A> scala2JavaOption​(scala.Option<A> o)
      • forEach

        public static void forEach​(java.util.function.Consumer<? super T> x$1)
      • spliterator

        public static java.util.Spliterator<T> spliterator()
      • get

        public abstract A get()
      • getOrElse

        public abstract <B> B getOrElse​(B defaultValue)
        Returns a if this is some(a) or defaultValue if this is none.
        Parameters:
        defaultValue - (undocumented)
        Returns:
        (undocumented)
      • isEmpty

        public abstract boolean isEmpty()
      • isDefined

        public boolean isDefined()
      • asScala

        public abstract scala.Option<A> asScala()
      • iterator

        public java.util.Iterator<A> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<A>