final class _Class[+A] extends AnyVal with Any.Able.ToString

Value Outcome

Outcome holds either value (tested by isValue) or Deficiency

The former can be accessed with value and valueOpt, the latter with deficiency and deficiencyOpt

Outcome is similar to scala.Try with two notable differences:

  • scala.Try captures errors, where Outcome holds Deficiency, which may include not only errors, but also business logic shortcomings
  • Unlike scala.Try when mapped, Outcome does not captures exceptions. Exceptions are only captured when directly mapping Future
Ordering
  1. Alphabetic
Inherited
  1. Out
  2. Any.Able.ToString
  3. scala.AnyVal
  4. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. def apply(f: (A) ⇒ Any, df: (Deficiency) ⇒ Any = \/): Out[A]

    Process outcome, both: success and failure

    Process outcome, both: success and failure

    Takes two functions, one to process success, another - failure

    Definition Classes
    _Class
  2. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  3. def convert[B](f: (A) ⇒ B, df: (Deficiency) ⇒ B): B

    Convert outcome, both: success and failure

    Convert outcome, both: success and failure

    Takes two functions, one to convert success, another - failure

    Definition Classes
    _Class
  4. def deficiency: Deficiency

    Failure description

    Failure description

    Returns outcome Deficiency

    Note. Will fail for successful outcome

    Definition Classes
    _Class
  5. def deficiencyOpt: Opt[Deficiency]

    Failure option

    Failure option

    Returns outcome Deficiency or Opt.Void if outcome is a success

    Definition Classes
    _Class
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. def isValue: Boolean

    Checks if this Outcome holds value

    Checks if this Outcome holds value

    if isValue is false, this Outcome holds Deficiency

    Definition Classes
    _Class
  8. def letMap[B](f: (A) ⇒ Out[B]): Out[B]

    Map value

    Map value

    Maps outcome value to another value or Deficiency

    Definition Classes
    _Class
  9. def map[B](f: (A) ⇒ B): Out[B]

    Map value

    Map value

    Maps outcome value

    Already failed outcomes are returned as is

    Definition Classes
    _Class
  10. def toString: String

    Custom String description

    Custom String description

    Overrides default toString method with custom description

    Definition Classes
    _ClassToString → Any
  11. def value: A

    Outcome value

    Outcome value

    Returns outcome value

    Note. Will fail for failed outcome

    Definition Classes
    _Class
  12. def valueOpt: Opt[A]

    Outcome optional value

    Outcome optional value

    Optionally returns outcome value or Opt.Void if outcome is failed

    Definition Classes
    _Class

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
Linear Supertypes
Any.Able.ToString, AnyVal, Any
Source: _Class.scala