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>
    Deprecated.
    Will be removed in favor of java.util.Optional in Pekko 2.0.0. Since 1.2.0.
    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>
      Deprecated.
      Class Some[A] represents existing values of type A.
      static class  Option.Some$
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      Option()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract scala.Option<A> asScala()
      Deprecated.
       
      static <T> Option<T> fromScalaOption​(scala.Option<T> scalaOption)
      Deprecated.
      Converts a Scala Option to a Java Option
      abstract A get()
      Deprecated.
       
      abstract <B> B getOrElse​(B defaultValue)
      Deprecated.
      Returns a if this is some(a) or defaultValue if this is none.
      boolean isDefined()
      Deprecated.
       
      abstract boolean isEmpty()
      Deprecated.
       
      java.util.Iterator<A> iterator()
      Deprecated.
       
      static <A> scala.Option<A> java2ScalaOption​(Option<A> o)
      Deprecated.
       
      static <A> Option<A> none()
      Deprecated.
      Option factory that creates None
      static <A> Option<A> option​(A v)
      Deprecated.
      Option factory that creates None if v is null, Some(v) otherwise.
      static <A> Option<A> scala2JavaOption​(scala.Option<A> o)
      Deprecated.
       
      static <A> Option<A> some​(A v)
      Deprecated.
      Option factory that creates Some
      • 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()
        Deprecated.
    • Method Detail

      • some

        public static <A> Option<A> some​(A v)
        Deprecated.
        Option factory that creates Some
      • none

        public static <A> Option<A> none()
        Deprecated.
        Option factory that creates None
      • option

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

        public static <T> Option<T> fromScalaOption​(scala.Option<T> scalaOption)
        Deprecated.
        Converts a Scala Option to a Java Option
      • java2ScalaOption

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

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

        public abstract A get()
        Deprecated.
      • getOrElse

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

        public abstract boolean isEmpty()
        Deprecated.
      • isDefined

        public boolean isDefined()
        Deprecated.
      • asScala

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

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