JsResult

play.api.libs.json.JsResult
See theJsResult companion trait
object JsResult

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
JsResult.type

Members list

Type members

Classlikes

case class Exception(cause: JsError) extends Exception, NoStackTrace

Attributes

Supertypes
trait Product
trait Equals
trait NoStackTrace
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def fromTry[T](result: Try[T], err: Throwable => JsError): JsResult[T]

Returns a scala.util.Try as JSON validation.

Returns a scala.util.Try as JSON validation.

Type parameters

T

the type for the parsing

Value parameters

err

the function to be applied for scala.util.Failure

result

the result

Attributes

def toTry[T](result: JsResult[T], err: JsError => Throwable): Try[T]

Returns a JSON validation as a scala.util.Try.

Returns a JSON validation as a scala.util.Try.

Type parameters

T

the type for the parsing

Value parameters

err

the function to be applied if the results is an error

import scala.concurrent.Future
import play.api.libs.json.JsResult
def toFuture[T](res: JsResult[T]): Future[T] =
 Future.fromTry(JsResult.toTry(res))
result

the JSON validation result

Attributes

Implicits

Implicits

implicit def alternativeJsResult(implicit a: Applicative[JsResult]): Alternative[JsResult]
implicit val applicativeJsResult: Applicative[JsResult]
implicit val functorJsResult: Functor[JsResult]