diode.util

Ready

final case class Ready[+A](x: A) extends Pot[A] with Product with Serializable

Linear Supertypes
Pot[A], Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Ready
  2. Pot
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Ready(x: A)

Type Members

  1. 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.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def collect[B](pf: PartialFunction[A, B]): Pot[B]

    Returns a Ready containing the result of applying pf to this Pot's contained value, if this pot is nonempty and pf is defined for that value.

    Returns a Ready containing the result of applying pf to this Pot's contained value, if this pot is nonempty and pf is defined for that value. Returns Empty otherwise.

    pf

    the partial function.

    returns

    the result of applying pf to this Pot's value (if possible), or Empty.

    Definition Classes
    Pot
    Annotations
    @inline()
    Example:
    1. // 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}
  9. final def contains[A1 >: A](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

    true if the pot has an element that is equal (as determined by ==) to elem, false otherwise.

    Definition Classes
    Pot
    Example:
    1. // 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"
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def exceptionOption: Option[Throwable]

    Definition Classes
    Pot
  12. final def exists(p: (A) ⇒ 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()
  13. def fail(exception: Throwable): FailedStale[A]

    Definition Classes
    ReadyPot
  14. final def filter(p: (A) ⇒ Boolean): Pot[A]

    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()
  15. final def filterNot(p: (A) ⇒ Boolean): Pot[A]

    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()
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def flatMap[B](f: (A) ⇒ 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 Empty if this Pot is empty. Slightly different from map in that $f is expected to return a pot (which could be Empty).

    f

    the function to apply

    Definition Classes
    Pot
    Annotations
    @inline()
    See also

    foreach

    map

  18. def flatten[B](implicit ev: <:<[A, Pot[B]]): Pot[B]

    Definition Classes
    Pot
  19. final def fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ 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.

  20. final def forall(p: (A) ⇒ 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()
  21. final def foreach[U](f: (A) ⇒ 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

    flatMap

    map

  22. def get: A

    Definition Classes
    ReadyPot
  23. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  24. final def getOrElse[B >: A](default: ⇒ B): B

    Definition Classes
    Pot
    Annotations
    @inline()
  25. def isEmpty: Boolean

    Definition Classes
    ReadyPot
  26. def isFailed: Boolean

    Definition Classes
    ReadyPot
  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. def isPending: Boolean

    Definition Classes
    ReadyPot
  29. def isReady: Boolean

    Definition Classes
    Pot
  30. def isStale: Boolean

    Definition Classes
    ReadyPot
  31. def iterator: Iterator[A]

    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
  32. final def map[B](f: (A) ⇒ 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 Empty.

    f

    the function to apply

    Definition Classes
    Pot
    Annotations
    @inline()
    Note

    This is similar to flatMap except here, $f does not need to wrap its result in a pot.

    See also

    foreach

    flatMap

  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. 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.

  35. final def notify(): Unit

    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  37. final def orElse[B >: A](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()
  38. def pending(policy: RetryPolicy): PendingStale[A]

    Definition Classes
    ReadyPot
  39. def ready[B >: A](value: B): Pot[B]

    Definition Classes
    Pot
  40. def recover[B >: A](f: PartialFunction[Throwable, B]): Pot[B]

    Applies the given function f if this is a Failure, otherwise returns this if this is a Success.

    Applies the given function f if this is a Failure, otherwise returns this if this is a Success. This is like map for the exception.

    Definition Classes
    Pot
  41. def recoverWith[B >: A](f: PartialFunction[Throwable, Pot[B]]): Pot[B]

    Applies the given function f if this is a Failure, otherwise returns this if this is a Success.

    Applies the given function f if this is a Failure, otherwise returns this if this is a Success. This is like flatMap for the exception.

    Definition Classes
    Pot
  42. def retriesLeft: Int

  43. def retry(policy: RetryPolicy): Nothing

    Definition Classes
    ReadyPot
  44. def retryPolicy: None.type

    Definition Classes
    ReadyPot
  45. def state: PotReady.type

    Definition Classes
    ReadyPot
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. final def toLeft[X](right: ⇒ X): Product with Serializable with Either[A, X]

    Returns a scala.util.Right containing the given argument right if 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 right if 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

  48. def toList: List[A]

    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
  49. def toOption: Option[A]

    Returns None if this is empty or a Some containing the value otherwise.

    Returns None if this is empty or a Some containing the value otherwise.

    Definition Classes
    Pot
    Annotations
    @inline()
  50. final def toRight[X](left: ⇒ X): Product with Serializable with Either[X, A]

    Returns a scala.util.Left containing the given argument left if 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 left if 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

  51. def toTry: Try[A]

    Returns Failure if this has failed or a Success containing the value otherwise.

    Returns Failure if this has failed or a Success containing the value otherwise.

    Definition Classes
    Pot
  52. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def withFilter(p: (A) ⇒ Boolean): WithFilter

    Necessary to keep Pot from being implicitly converted to scala.collection.Iterable in for comprehensions.

    Necessary to keep Pot from being implicitly converted to scala.collection.Iterable in for comprehensions.

    Definition Classes
    Pot
    Annotations
    @inline()
  56. val x: A

Inherited from Pot[A]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped