Packages

c

play.api.libs.json

JsSuccess

case class JsSuccess[T](value: T, path: JsPath = JsPath()) extends JsResult[T] with Product with Serializable

The result for a successful parsing.

Source
JsResult.scala
Linear Supertypes
Serializable, Product, Equals, JsResult[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsSuccess
  2. Serializable
  3. Product
  4. Equals
  5. JsResult
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsSuccess(value: T, path: JsPath = JsPath())

Type Members

  1. final class WithFilter extends AnyRef
    Definition Classes
    JsResult

Value Members

  1. def asEither: Either[Seq[(JsPath, Seq[JsonValidationError])], T]

    Returns either the result errors (at Left), or the successful value (at Right).

    Returns either the result errors (at Left), or the successful value (at Right).

    Definition Classes
    JsSuccessJsResult
  2. def asOpt: Option[T]

    Transforms this result either Some option with the successful value, or as None in case of JSON error.

    Transforms this result either Some option with the successful value, or as None in case of JSON error.

    Definition Classes
    JsSuccessJsResult
  3. def collect[B](otherwise: JsonValidationError)(p: PartialFunction[T, B]): JsResult[B]
    Definition Classes
    JsResult
  4. def contains[AA >: T](elem: AA): Boolean

    If this result is successful than checks for presence for elem, otherwise return false

    If this result is successful than checks for presence for elem, otherwise return false

    Definition Classes
    JsSuccessJsResult
  5. def exists(p: (T) => Boolean): Boolean

    If this result is successful than check value with predicate p, otherwise return false

    If this result is successful than check value with predicate p, otherwise return false

    Definition Classes
    JsSuccessJsResult
  6. def filter(otherwise: JsError)(p: (T) => Boolean): JsResult[T]
    Definition Classes
    JsResult
  7. def filter(p: (T) => Boolean): JsResult[T]
    Definition Classes
    JsResult
  8. def filterNot(p: (T) => Boolean): JsResult[T]
    Definition Classes
    JsResult
  9. def filterNot(error: JsError)(p: (T) => Boolean): JsResult[T]
    Definition Classes
    JsResult
  10. def flatMap[U](f: (T) => JsResult[U]): JsResult[U]

    If this result is successful, applies the function f on the parsed value.

    If this result is successful, applies the function f on the parsed value.

    Definition Classes
    JsSuccessJsResult
  11. def fold[U](invalid: (Seq[(JsPath, Seq[JsonValidationError])]) => U, valid: (T) => U): U

    Either applies the invalid function if this result is an error, or applies the valid function on the successful value.

    Either applies the invalid function if this result is an error, or applies the valid function on the successful value.

    Definition Classes
    JsSuccessJsResult
  12. def forall(p: (T) => Boolean): Boolean

    If this result is successful than check value with predicate p, otherwise return true.

    If this result is successful than check value with predicate p, otherwise return true. Follows scala.collection.Traversable.forall semantics

    Definition Classes
    JsSuccessJsResult
  13. def foreach(f: (T) => Unit): Unit

    If this result is successful, applies the function f on the parsed value.

    If this result is successful, applies the function f on the parsed value.

    Definition Classes
    JsSuccessJsResult
  14. def get: T

    Not recommended

    Not recommended

    Definition Classes
    JsSuccessJsResult
  15. def getOrElse[U >: T](t: => U): U

    Either returns the successful value, or the value from t.

    Either returns the successful value, or the value from t.

    Definition Classes
    JsSuccessJsResult
  16. val isError: Boolean
    Definition Classes
    JsSuccessJsResult
  17. val isSuccess: Boolean
    Definition Classes
    JsSuccessJsResult
  18. def map[U](f: (T) => U): JsResult[U]

    If this result is successful, applies the function f on the parsed value.

    If this result is successful, applies the function f on the parsed value.

    Definition Classes
    JsSuccessJsResult
  19. def orElse[U >: T](t: => JsResult[U]): JsResult[U]

    Either returns this result if successful, or the result from t.

    Either returns this result if successful, or the result from t.

    Definition Classes
    JsSuccessJsResult
  20. val path: JsPath
  21. def productElementNames: Iterator[String]
    Definition Classes
    Product
  22. def recover[U >: T](errManager: PartialFunction[JsError, U]): JsResult[U]

    If this result is not successful, recovers the errors with the given function.

    If this result is not successful, recovers the errors with the given function.

    Definition Classes
    JsSuccessJsResult
  23. def recoverTotal[U >: T](errManager: (JsError) => U): U

    If this result is not successful, recovers the errors with the given function.

    If this result is not successful, recovers the errors with the given function.

    Definition Classes
    JsSuccessJsResult
  24. def recoverWith[U >: T](errManager: (JsError) => JsResult[U]): JsResult[U]

    If this result is not successful, recovers the errors with the given function.

    If this result is not successful, recovers the errors with the given function.

    Definition Classes
    JsSuccessJsResult
  25. def repath(path: JsPath): JsResult[T]

    Updates the JSON path

    Updates the JSON path

    Definition Classes
    JsSuccessJsResult
  26. val value: T
  27. def withFilter(p: (T) => Boolean): WithFilter
    Definition Classes
    JsResult