Packages

object Result

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Result
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class Errors(errors: NonEmptyErrorsChain) extends Result[Nothing] with Product with Serializable

    Errors case representation

    Errors case representation

    errors

    non-empty collection of path-annotated errors

    Since

    0.7.0

  2. final case class Value[A](value: A) extends Result[A] with Product with Serializable

    Success value case representation

    Success value case representation

    A

    type of success value

    value

    value of type T

    Since

    0.7.0

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def fromCatching[A](value: => A): Result[A]

    Converts possibly throwing computation into Result.

    Converts possibly throwing computation into Result.

    A

    type of successful result

    value

    computation to run while catching its exceptions

    returns

    successful Result if computation didn't throw, failed Result with caught exception if it threw

    Since

    0.7.0

  10. final def fromEither[A](value: Either[Errors, A]): Result[A]

    Converts Either to Result, using Errors from Left as failed result.

    Converts Either to Result, using Errors from Left as failed result.

    A

    type of successful result

    value

    Either to convert

    returns

    successful result if scala.Right, failed result if scala.Left

    Since

    0.7.0

  11. final def fromEitherString[A](value: Either[String, A]): Result[A]

    Converts Either to Result, using an error message from Left as failed result.

    Converts Either to Result, using an error message from Left as failed result.

    A

    type of successful result

    value

    Either to convert

    returns

    successful result if scala.Right, failed result with an error message if scala.Left

    Since

    0.7.0

  12. final def fromEmpty[A]: Result[A]

    Creates failed Result with an empty value error.

    Creates failed Result with an empty value error.

    A

    type of successful result

    returns

    failed result

    Since

    0.7.0

  13. final def fromError[A](error: Error): Result[A]

    Creates failed result from a single error.

    Creates failed result from a single error.

    A

    type of successful result

    error

    required error

    returns

    result containing one error

    Since

    0.7.0

  14. final def fromErrorNotDefinedAt[A](value: Any): Result[A]

    Creates failed result from argument for which PartialFunction was not defined.

    Creates failed result from argument for which PartialFunction was not defined.

    A

    type of successful result

    value

    value for which partial function was not defined

    returns

    result containing one error

    Since

    0.7.0

  15. final def fromErrorString[A](message: String): Result[A]

    Creates failed result from an error message.

    Creates failed result from an error message.

    A

    type of successful result

    message

    message to wrap in Error

    returns

    result containing one error

    Since

    0.7.0

  16. final def fromErrorStrings[A](message: String, messages: String*): Result[A]

    Creates failed result from one error message or more.

    Creates failed result from one error message or more.

    A

    type of successful result

    message

    required message to wrap in Error

    messages

    optional messages to wrap in Error

    returns

    result aggregating all passed errors

    Since

    0.7.0

  17. final def fromErrorThrowable[W](throwable: Throwable): Result[W]

    Creates failed result from Exception that was caught.

    Creates failed result from Exception that was caught.

    W

    type of successful result

    throwable

    exception

    returns

    result containing one error

    Since

    0.7.0

  18. final def fromErrors[A](error: Error, errors: Error*): Result[A]

    Creates failed result from one error or more.

    Creates failed result from one error or more.

    A

    type of successful result

    error

    required head io.scalaland.chimney.partial.Error

    errors

    optional tail io.scalaland.chimney.partial.Errors

    returns

    result aggregating all passed errors

    Since

    0.7.0

  19. final def fromFunction[A, B](f: (A) => B): (A) => Result[B]

    Converts a function that throws Exceptions into function that returns Result.

    Converts a function that throws Exceptions into function that returns Result.

    A

    input type

    B

    output type

    f

    function that possibly throws

    returns

    function that caches Exceptions as failed results

    Since

    0.7.0

  20. final def fromOption[A](value: Option[A]): Result[A]

    Converts Option to Result, using EmptyValue error if None.

    Converts Option to Result, using EmptyValue error if None.

    A

    type of successful result

    value

    Option to convert

    returns

    successful result if scala.Some, failed result with EmptyValue error if None

    Since

    0.7.0

  21. final def fromOptionOrError[A](value: Option[A], ifEmpty: => Error): Result[A]

    Converts Option to Result, using provided Error if None.

    Converts Option to Result, using provided Error if None.

    A

    type of successful result

    value

    Option to convert

    ifEmpty

    lazy error for scala.None

    returns

    successful result if scala.Some, failed result with provided error if scala.None

    Since

    0.7.0

  22. final def fromOptionOrString[A](value: Option[A], ifEmpty: => String): Result[A]

    Converts Option to Result, using provided error message if None.

    Converts Option to Result, using provided error message if None.

    A

    type of successful result

    value

    Option to convert

    ifEmpty

    lazy error message for scala.None

    returns

    successful result if scala.Some, failed result with provided error message if scala.None

    Since

    0.7.0

  23. final def fromOptionOrThrowable[A](value: Option[A], ifEmpty: => Throwable): Result[A]

    Converts Option to Result, using provided Throwable if None.

    Converts Option to Result, using provided Throwable if None.

    A

    type of successful result

    value

    Option to convert

    ifEmpty

    lazy error for scala.None

    returns

    successful result if scala.Some, failed result with provided Throwable if scala.None

    Since

    0.7.0

  24. final def fromPartialFunction[A, B](pf: PartialFunction[A, B]): (A) => Result[B]

    Converts a partial function that throws Exceptions into function that returns Result.

    Converts a partial function that throws Exceptions into function that returns Result.

    A

    input type

    B

    output type

    pf

    partial function that possibly throws

    returns

    function that caches Exceptions and arguments without defined value as failed Results

    Since

    0.7.0

  25. final def fromTry[A](value: Try[A]): Result[A]

    Converts Try to Result, using Throwable from Failure as failed result.

    Converts Try to Result, using Throwable from Failure as failed result.

    A

    type of successful result

    value

    Try to convert

    returns

    successful result if scala.util.Success, failed result with Throwable if scala.util.Failure

    Since

    0.7.0

  26. final def fromValue[A](value: A): Result[A]

    Creates successful Result from a precomputed value.

    Creates successful Result from a precomputed value.

    A

    type of sucessful value

    value

    successful value to return in result

    returns

    successful result

    Since

    0.7.0

  27. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. final def map2[A, B, C](resultA: Result[A], resultB: => Result[B], f: (A, B) => C, failFast: Boolean): Result[C]

    Combines 2 Results into 1 by combining their successful values or aggregating errors.

    Combines 2 Results into 1 by combining their successful values or aggregating errors.

    A

    first successful input type

    B

    second successful input type

    C

    successful output type

    resultA

    first Result

    resultB

    second Result

    f

    function combining 2 successful input values into successful output value

    failFast

    whether conversion should stop at first failed element or should it aggregate errors from both Results

    returns

    successful Result of combination if both results were successful, failed result if at least one of Result were failure

    Since

    0.7.0

  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def product[A, B](resultA: Result[A], resultB: => Result[B], failFast: Boolean): Result[(A, B)]

    Combines 2 Results into 1 by tupling their successful values or aggregating errors.

    Combines 2 Results into 1 by tupling their successful values or aggregating errors.

    A

    first successful input type

    B

    second successful input type

    resultA

    first Result

    resultB

    second Result

    failFast

    whether conversion should stop at first failed element or should it aggregate errors from both Results

    returns

    successful Result with a tuple if both results were successful, failed result if at least one of Result were failure

    Since

    0.7.0

  35. final def sequence[M, A](it: Iterator[Result[A]], failFast: Boolean)(implicit fac: Factory[A, M]): Result[M]

    Converts an Iterator containing Results into a Result with selected collection of successful values.

    Converts an Iterator containing Results into a Result with selected collection of successful values.

    M

    type of output - output collection of output element

    A

    type of successful values in Results

    it

    iterator with Results to aggregate

    failFast

    whether conversion should stop at first failed element conversion or should it continue to aggregate all errors

    fac

    factory of output type

    returns

    result with user-selected collection of converted elements if all conversions succeeded, result with conversion errors if at least one conversion failed

    Since

    0.7.0

  36. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. final def traverse[M, A, B](it: Iterator[A], f: (A) => Result[B], failFast: Boolean)(implicit fac: Factory[B, M]): Result[M]

    Converts an Iterator of input type into selected collection of output type, aggregating errors from conversions of individual elements.

    Converts an Iterator of input type into selected collection of output type, aggregating errors from conversions of individual elements.

    M

    type of output - output collection of output element

    A

    type of elements of input

    B

    type of elements of output

    it

    iterator with elements to convert

    f

    function converting each individual element to Result

    failFast

    whether conversion should stop at first failed element conversion or should it continue to aggregate all errors

    fac

    factory of output type

    returns

    result with user-selected collection of converted elements if all conversions succeeded, result with conversion errors if at least one conversion failed

    Since

    0.7.0

  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  42. object Errors extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped