Class

kantan.codecs.Result

Failure

Related Doc: package Result

Permalink

final case class Failure[F](value: F) extends Result[F, Nothing] with Product with Serializable

Linear Supertypes
Result[F, Nothing], Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Failure
  2. Result
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Failure(value: F)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def biFlatMap[FF >: F, SS >: Nothing](f: (FF) ⇒ Result[FF, SS], g: (SS) ⇒ Result[FF, SS]): Result[FF, SS]

    Permalink
    Definition Classes
    Result
  6. def bimap[FF, SS](f: (F) ⇒ FF, s: (Nothing) ⇒ SS): Result[FF, SS]

    Permalink
    Definition Classes
    Result
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensure[FF >: F](fail: ⇒ FF)(f: (Nothing) ⇒ Boolean): Failure[F]

    Permalink

    Turns any success whose underlying value doesn't validate the specified predicate into a failure.

    Turns any success whose underlying value doesn't validate the specified predicate into a failure.

    This is useful when not all successes are interesting. One might receive, for example, a success containing an int, but need to further reduce its domain to positive ints and turn any other into a failure.

    Definition Classes
    FailureResult
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def exists(f: (Nothing) ⇒ Boolean): Boolean

    Permalink

    Returns the result of applying the specified predicate to the underlying value if a success, false otherwise.

    Returns the result of applying the specified predicate to the underlying value if a success, false otherwise.

    Definition Classes
    FailureResult
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def flatMap[FF >: F, S](f: (Nothing) ⇒ Result[FF, S]): Failure[F]

    Permalink
    Definition Classes
    FailureResult
  13. def fold[C](ff: (F) ⇒ C, fs: (Nothing) ⇒ C): C

    Permalink
    Definition Classes
    FailureResult
  14. def foldLeft[A](acc: A)(f: (A, Nothing) ⇒ A): A

    Permalink
    Definition Classes
    Result
  15. def foldRight[A](acc: A)(f: (Nothing, A) ⇒ A): A

    Permalink
    Definition Classes
    Result
  16. def forall(f: (Nothing) ⇒ Boolean): Boolean

    Permalink

    Returns the result of applying the specified predicate to the underlying value if a success, false otherwise.

    Returns the result of applying the specified predicate to the underlying value if a success, false otherwise.

    Definition Classes
    FailureResult
  17. def foreach(f: (Nothing) ⇒ Unit): Unit

    Permalink

    Applies the specified procedure on the underlying value if a success, does nothing otherwise.

    Applies the specified procedure on the underlying value if a success, does nothing otherwise.

    This is useful when one wants to have side-effects that depend on the success' value - print it, for example.

    Definition Classes
    FailureResult
  18. def get: Nothing

    Permalink

    Returns the underlying value if a success, throws an exception otherwise.

    Returns the underlying value if a success, throws an exception otherwise.

    Other value retrieval methods, such as getOrElse or valueOr, should almost always be preferred.

    Definition Classes
    FailureResult
    Annotations
    @SuppressWarnings()
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def getOrElse[SS](default: ⇒ SS): SS

    Permalink

    Returns the underlying value if a success, the specified default value otherwise.

    Returns the underlying value if a success, the specified default value otherwise.

    This is useful when one needs to provide a default value in case of a failure.

    Definition Classes
    FailureResult
  21. def isFailure: Boolean

    Permalink

    Returns true if the result is a failure.

    Returns true if the result is a failure.

    Definition Classes
    Result
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. def isSuccess: Boolean

    Permalink

    Returns true if the result is a success.

    Returns true if the result is a success.

    Definition Classes
    FailureResult
  24. def leftFlatMap[FF, SS](f: (F) ⇒ Result[FF, SS]): Result[FF, SS]

    Permalink
    Definition Classes
    FailureResult
  25. def leftMap[FF](f: (F) ⇒ FF): Failure[FF]

    Permalink
    Definition Classes
    FailureResult
  26. def map[S](f: (Nothing) ⇒ S): Failure[F]

    Permalink
    Definition Classes
    FailureResult
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def orElse[FF >: F, SS](default: ⇒ Result[FF, SS]): Result[FF, SS]

    Permalink

    Returns the specified default value if a failure, does nothing otherwise.

    Returns the specified default value if a failure, does nothing otherwise.

    Definition Classes
    FailureResult
  31. def recover[SS](pf: PartialFunction[F, SS]): Result[F, SS]

    Permalink

    Turns any failure whose value is defined for specified partial function into a success with the corresponding value.

    Turns any failure whose value is defined for specified partial function into a success with the corresponding value.

    This is useful when some error conditions are actually valid answers - one could imagine, for instance, that failure to parse a boolean could be turned into a successful parsing of false.

    Definition Classes
    FailureResult
  32. def recoverWith[SS, FF >: F](pf: PartialFunction[F, Result[FF, SS]]): Result[FF, SS]

    Permalink

    Turns any failure whose value is defined for specified partial function into the corresponding value.

    Turns any failure whose value is defined for specified partial function into the corresponding value.

    This is useful when some error conditions have fallback solutions - one could imagine, for instance, that failure to parse a file because it does not exist can be retried on a secondary possible location for the file.

    Definition Classes
    FailureResult
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toEither: Left[F, Nothing]

    Permalink

    Turns a success into a Right and a failure into a Left.

    Turns a success into a Right and a failure into a Left.

    Definition Classes
    FailureResult
  35. val toList: Nil.type

    Permalink

    Turns a success into a singleton list and a failure into an empty list.

    Turns a success into a singleton list and a failure into an empty list.

    Definition Classes
    FailureResult
  36. val toOption: None.type

    Permalink

    Turns a success into a Some and a failure into a None.

    Turns a success into a Some and a failure into a None.

    Definition Classes
    FailureResult
  37. val value: F

    Permalink
  38. def valueOr[SS](f: (F) ⇒ SS): SS

    Permalink

    Returns the underlying value if a success, the result of applying the specified function to the failure value otherwise.

    Returns the underlying value if a success, the result of applying the specified function to the failure value otherwise.

    This is typically useful when one needs to provide a default value that depends on how an operation failed.

    Definition Classes
    FailureResult
    See also

    recover, recoverWith

  39. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Result[F, Nothing]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped