object Empty extends Pot[Nothing] with Product with Serializable
- Alphabetic
- By Inheritance
- Empty
- Pot
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
WithFilter extends AnyRef
We need a whole WithFilter class to honor the "doesn't create a new collection" contract even though it seems unlikely to matter much in a collection with max size 1.
We need a whole WithFilter class to honor the "doesn't create a new collection" contract even though it seems unlikely to matter much in a collection with max size 1.
- Definition Classes
- Pot
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
collect[B](pf: PartialFunction[Nothing, B]): Pot[B]
Returns a Ready containing the result of applying
pfto this Pot's contained value, if this pot is nonempty andpfis defined for that value.Returns a Ready containing the result of applying
pfto this Pot's contained value, if this pot is nonempty andpfis defined for that value. Returns Empty otherwise.- pf
the partial function.
- returns
the result of applying
pfto this Pot's value (if possible), or Empty.
- Definition Classes
- Pot
- Annotations
- @inline()
// Returns Ready(HTTP) because the partial function covers the case. Ready("http") collect {case "http" => "HTTP"} // Returns Empty because the partial function doesn't cover the case. Ready("ftp") collect {case "http" => "HTTP"} // Returns Empty because Empty is passed to the collect method. Empty collect {case value => value}
Example: -
final
def
contains[A1 >: Nothing](elem: A1): Boolean
Tests whether the pot contains a given value as an element.
Tests whether the pot contains a given value as an element.
- elem
the element to test.
- returns
trueif the pot has an element that is equal (as determined by==) toelem,falseotherwise.
- Definition Classes
- Pot
// Returns true because Ready instance contains string "something" which equals "something". Ready("something") contains "something" // Returns false because "something" != "anything". Ready("something") contains "anything" // Returns false when method called on Empty. Empty contains "anything"
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exceptionOption: Option[Throwable]
- Definition Classes
- Pot
-
final
def
exists(p: (Nothing) ⇒ Boolean): Boolean
Returns true if this pot is nonempty and the predicate $p returns true when applied to this Pot's value.
Returns true if this pot is nonempty and the predicate $p returns true when applied to this Pot's value. Otherwise, returns false.
- p
the predicate to test
- Definition Classes
- Pot
- Annotations
- @inline()
- def fail(exception: Throwable): Failed
-
final
def
filter(p: (Nothing) ⇒ Boolean): Pot[Nothing]
Returns this Pot if it is nonempty and applying the predicate $p to this Pot's value returns true.
Returns this Pot if it is nonempty and applying the predicate $p to this Pot's value returns true. Otherwise, return Empty.
- p
the predicate used for testing.
- Definition Classes
- Pot
- Annotations
- @inline()
-
final
def
filterNot(p: (Nothing) ⇒ Boolean): Pot[Nothing]
Returns this Pot if it is nonempty and applying the predicate $p to this Pot's value returns false.
Returns this Pot if it is nonempty and applying the predicate $p to this Pot's value returns false. Otherwise, return Empty.
- p
the predicate used for testing.
- Definition Classes
- Pot
- Annotations
- @inline()
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (Nothing) ⇒ Pot[B]): Pot[B]
Returns the result of applying $f to this Pot's value if this Pot is nonempty.
Returns the result of applying $f to this Pot's value if this Pot is nonempty. Returns current Pot if this Pot does not have a value. Slightly different from
mapin that $f is expected to return a pot (which could be Empty).- f
the function to apply
- Definition Classes
- Pot
- Annotations
- @noinline()
- See also
map
foreach
-
def
flatten[B](implicit ev: <:<[Nothing, Pot[B]]): Pot[B]
- Definition Classes
- Pot
- Annotations
- @noinline()
-
final
def
fold[B](ifEmpty: ⇒ B)(f: (Nothing) ⇒ B): B
Returns the result of applying $f to this Pot's value if the Pot is nonempty.
Returns the result of applying $f to this Pot's value if the Pot is nonempty. Otherwise, evaluates expression
ifEmpty.- ifEmpty
the expression to evaluate if empty.
- f
the function to apply if nonempty.
- Definition Classes
- Pot
- Annotations
- @inline()
- Note
This is equivalent to
Pot map f getOrElse ifEmpty.
-
final
def
forall(p: (Nothing) ⇒ Boolean): Boolean
Returns true if this pot is empty or the predicate $p returns true when applied to this Pot's value.
Returns true if this pot is empty or the predicate $p returns true when applied to this Pot's value.
- p
the predicate to test
- Definition Classes
- Pot
- Annotations
- @inline()
-
final
def
foreach[U](f: (Nothing) ⇒ U): Unit
Apply the given procedure $f to the pot's value, if it is nonempty.
Apply the given procedure $f to the pot's value, if it is nonempty. Otherwise, do nothing.
- f
the procedure to apply.
- Definition Classes
- Pot
- Annotations
- @inline()
- See also
map
flatMap
- def get: Nothing
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
getOrElse[B >: Nothing](default: ⇒ B): B
- Definition Classes
- Pot
- Annotations
- @inline()
- def isEmpty: Boolean
- def isFailed: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPending: Boolean
-
def
isReady: Boolean
- Definition Classes
- Pot
- def isStale: Boolean
- def isUnavailable: Boolean
-
def
iterator: Iterator[Nothing]
Returns a singleton iterator returning the Pot's value if it is nonempty, or an empty iterator if the pot is empty.
Returns a singleton iterator returning the Pot's value if it is nonempty, or an empty iterator if the pot is empty.
- Definition Classes
- Pot
-
final
def
map[B](f: (Nothing) ⇒ B): Pot[B]
Returns a Ready containing the result of applying $f to this Pot's value if this Pot is nonempty.
Returns a Ready containing the result of applying $f to this Pot's value if this Pot is nonempty. Otherwise return current Pot.
- f
the function to apply
- Definition Classes
- Pot
- Annotations
- @noinline()
- Note
This is similar to
flatMapexcept here, $f does not need to wrap its result in a pot.- See also
flatMap
foreach
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
nonEmpty: Boolean
Returns false if the pot is Empty, true otherwise.
Returns false if the pot is Empty, true otherwise.
- Definition Classes
- Pot
- Note
Implemented here to avoid the implicit conversion to Iterable.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
orElse[B >: Nothing](alternative: ⇒ Pot[B]): Pot[B]
Returns this Pot if it is nonempty, otherwise return the result of evaluating
alternative.Returns this Pot if it is nonempty, otherwise return the result of evaluating
alternative.- alternative
the alternative expression.
- Definition Classes
- Pot
- Annotations
- @inline()
- def pending(startTime: Long = Pot.currentTime): Pending
-
def
ready[B >: Nothing](value: B): Pot[B]
- Definition Classes
- Pot
-
def
recover[B >: Nothing](f: PartialFunction[Throwable, B]): Pot[B]
Applies the given function
fif this is aFailure, otherwise returns this if this is aSuccess.Applies the given function
fif this is aFailure, otherwise returns this if this is aSuccess. This is like map for the exception.- Definition Classes
- Pot
-
def
recoverWith[B >: Nothing](f: PartialFunction[Throwable, Pot[B]]): Pot[B]
Applies the given function
fif this is aFailure, otherwise returns this if this is aSuccess.Applies the given function
fif this is aFailure, otherwise returns this if this is aSuccess. This is likeflatMapfor the exception.- Definition Classes
- Pot
- def retriesLeft: Int
- def retryPolicy: None.type
- def state: PotEmpty.type
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toLeft[X](right: ⇒ X): Either[Nothing, X]
Returns a scala.util.Right containing the given argument
rightif this is empty, or a scala.util.Left containing this Pot's value if this Pot is nonempty.Returns a scala.util.Right containing the given argument
rightif this is empty, or a scala.util.Left containing this Pot's value if this Pot is nonempty.- right
the expression to evaluate and return if this is empty
- Definition Classes
- Pot
- Annotations
- @inline()
- See also
toRight
-
def
toList: List[Nothing]
Returns a singleton list containing the Pot's value if it is nonempty, or the empty list if the Pot is empty.
Returns a singleton list containing the Pot's value if it is nonempty, or the empty list if the Pot is empty.
- Definition Classes
- Pot
-
def
toOption: Option[Nothing]
Returns
Noneif this is empty or aSomecontaining the value otherwise.Returns
Noneif this is empty or aSomecontaining the value otherwise.- Definition Classes
- Pot
- Annotations
- @inline()
-
final
def
toRight[X](left: ⇒ X): Either[X, Nothing]
Returns a scala.util.Left containing the given argument
leftif this Pot is empty, or a scala.util.Right containing this Pot's value if this is nonempty.Returns a scala.util.Left containing the given argument
leftif this Pot is empty, or a scala.util.Right containing this Pot's value if this is nonempty.- left
the expression to evaluate and return if this is empty
- Definition Classes
- Pot
- Annotations
- @inline()
- See also
toLeft
-
def
toTry: Try[Nothing]
Returns
Failureif this has failed or aSuccesscontaining the value otherwise.Returns
Failureif this has failed or aSuccesscontaining the value otherwise.- Definition Classes
- Pot
-
def
unavailable(): Unavailable.type
- Definition Classes
- Pot
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
withFilter(p: (Nothing) ⇒ Boolean): WithFilter
Necessary to keep Pot from being implicitly converted to scala.collection.Iterable in
forcomprehensions.Necessary to keep Pot from being implicitly converted to scala.collection.Iterable in
forcomprehensions.- Definition Classes
- Pot
- Annotations
- @inline()