org.codeswarm.fallible

Fallible

sealed abstract class Fallible[+A, +E] extends AnyRef

Represents a value or a list of errors explaining why the value is absent. Instances of Fallible[A, E] are an instance of either Success[A] or Failure[E].

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Fallible
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Fallible()

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. def &&[B, E1 >: E](that: Fallible[B, E1]): Fallible[(A, B), E1]

    Returns Success containing a tuple of this value and that value if both this and that are instances of Success, or Failure if either is an instance of Failure.

    Returns Success containing a tuple of this value and that value if both this and that are instances of Success, or Failure if either is an instance of Failure.

    This is somewhat analogous to a Boolean and operation, because the result is Success if and only if this and that are Success.

  5. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def flatMap[B, E1 >: E](f: (A) ⇒ Fallible[B, E1]): Fallible[B, E1]

    Returns the result of applying a fallible transformation f to this object's value if this is an instance of success.

    Returns the result of applying a fallible transformation f to this object's value if this is an instance of success.

    The resulting object will be an instance of Success if and only if both this and the transformation result are instances of Success.

  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def getErrors: List[E]

    Returns all errors.

    Returns all errors.

    If this is an instance of Success, returns an empty list, An instance of Failure may also return an empty list, denoting failure without any explanation.

  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. def isFailure: Boolean

    Returns true if this is an instance of Failure, or false otherwise.

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def isSuccess: Boolean

    Returns true if this is an instance of Success, or false otherwise.

  19. def map[B, E1 >: E](f: (A) ⇒ B): Fallible[B, E1]

    Returns the result of applying f to this object's value if this is an instance of Success.

  20. def mapError[E1](f: (E) ⇒ E1): Fallible[A, E1]

    Returns the result of applying f to each error.

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

    Definition Classes
    AnyRef
  22. final def notify(): Unit

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

    Definition Classes
    AnyRef
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toEither: Either[List[E], A]

    Returns Right if this is an instance of Success, or Left otherwise.

  26. def toOption: Option[A]

    Returns Some if this is an instance of Success, or None otherwise.

  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def ||[A1 >: A, E1 >: E](that: Fallible[A1, E1]): Fallible[A1, E1]

    Returns the first Success among this and that, or Failure if both are failures.

    Returns the first Success among this and that, or Failure if both are failures.

    This is somewhat analogous to a Boolean or operation, because the result is Success if and only if this or that is Success.

    If both this and that are instances of Failure, then the result contains the errors from both Failures.

    This method may be useful if you need to select a single value from a sequence of fallible fallbacks.

Inherited from AnyRef

Inherited from Any

Ungrouped