kantan.codecs.Result

Success

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

Linear Supertypes
Result[Nothing, S], Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Success
  2. Result
  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 Success(value: S)

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 biFlatMap[FF >: Nothing, SS >: S](f: (FF) ⇒ Result[FF, SS], g: (SS) ⇒ Result[FF, SS]): Result[FF, SS]

    Definition Classes
    Result
  8. def bimap[FF, SS](f: (Nothing) ⇒ FF, s: (S) ⇒ SS): Result[FF, SS]

    Definition Classes
    Result
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def ensure[FF](fail: ⇒ FF)(f: (S) ⇒ Boolean): Result[FF, S]

    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
    SuccessResult
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def exists(f: (S) ⇒ Boolean): Boolean

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flatMap[FF, SS](f: (S) ⇒ Result[FF, SS]): Result[FF, SS]

    Definition Classes
    SuccessResult
  15. def fold[C](ff: (Nothing) ⇒ C, fs: (S) ⇒ C): C

    Definition Classes
    SuccessResult
  16. def foldLeft[A](acc: A)(f: (A, S) ⇒ A): A

    Definition Classes
    Result
  17. def foldRight[A](acc: A)(f: (S, A) ⇒ A): A

    Definition Classes
    Result
  18. def forall(f: (S) ⇒ Boolean): Boolean

    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
    SuccessResult
  19. def foreach(f: (S) ⇒ Unit): Unit

    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
    SuccessResult
  20. def get: S

    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
    SuccessResult
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def getOrElse[SS >: S](default: ⇒ SS): S

    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
    SuccessResult
  23. def isFailure: Boolean

    Returns true if the result is a failure.

    Returns true if the result is a failure.

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

    Definition Classes
    Any
  25. def isSuccess: Boolean

    Returns true if the result is a success.

    Returns true if the result is a success.

    Definition Classes
    SuccessResult
  26. def leftFlatMap[FF, SS >: S](f: (Nothing) ⇒ Result[FF, SS]): Success[S]

    Definition Classes
    SuccessResult
  27. def leftMap[FF](f: (Nothing) ⇒ FF): Success[S]

    Definition Classes
    SuccessResult
  28. def map[SS](f: (S) ⇒ SS): Success[SS]

    Definition Classes
    SuccessResult
  29. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  32. def orElse[FF, SS >: S](default: ⇒ Result[FF, SS]): Success[S]

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

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

    Definition Classes
    SuccessResult
  33. def recover[SS >: S](pf: PartialFunction[Nothing, SS]): Success[S]

    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
    SuccessResult
  34. def recoverWith[SS >: S, FF](pf: PartialFunction[Nothing, Result[FF, SS]]): Success[S]

    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
    SuccessResult
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  36. def toEither: Right[Nothing, S]

    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
    SuccessResult
  37. def toList: List[S]

    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
    SuccessResult
  38. def toOption: Some[S]

    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
    SuccessResult
  39. val value: S

  40. def valueOr[SS >: S](f: (Nothing) ⇒ SS): S

    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
    SuccessResult
    See also

    recover, recoverWith

  41. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Result[Nothing, S]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped