Packages

c

play.api.libs.json

JsDefined

final case class JsDefined(value: JsValue) extends AnyVal with JsLookupResult with Product with Serializable

Wrapper for JsValue to represent an existing Json value.

Source
JsLookup.scala
Linear Supertypes
Serializable, Product, Equals, JsLookupResult, JsReadable, AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsDefined
  2. Serializable
  3. Product
  4. Equals
  5. JsLookupResult
  6. JsReadable
  7. AnyVal
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsDefined(value: JsValue)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def as[T](implicit fjs: Reads[T]): T

    Tries to convert the node into a T, throwing an exception if it can't.

    Tries to convert the node into a T, throwing an exception if it can't. An implicit Reads[T] must be defined.

    Definition Classes
    JsReadable
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asOpt[T](implicit fjs: Reads[T]): Option[T]

    Tries to convert the node into a T.

    Tries to convert the node into a T. An implicit Reads[T] must be defined. Any error is mapped to None

    returns

    Some[T] if it succeeds, None if it fails.

    Definition Classes
    JsReadable
  7. def get: JsValue
    Definition Classes
    JsLookupResult
  8. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  9. def getOrElse(v: => JsValue): JsValue
    Definition Classes
    JsLookupResult
  10. def isDefined: Boolean
    Definition Classes
    JsLookupResult
  11. def isEmpty: Boolean
    Definition Classes
    JsLookupResult
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def orElse(alternative: => JsLookupResult): JsLookupResult

    If this result is defined return this.

    If this result is defined return this. Otherwise return alternative.

    Definition Classes
    JsLookupResult
  14. def productElementNames: Iterator[String]
    Definition Classes
    Product
  15. def toEither: Either[JsonValidationError, JsValue]
    Definition Classes
    JsLookupResult
  16. def toOption: Option[JsValue]

    Tries to convert the node into a JsValue

    Tries to convert the node into a JsValue

    Definition Classes
    JsLookupResult
  17. def transform[A <: JsValue](rds: Reads[A]): JsResult[A]

    Transforms this node into a JsResult using provided Json transformer Reads[JsValue]

    Transforms this node into a JsResult using provided Json transformer Reads[JsValue]

    Definition Classes
    JsReadable
  18. def validate[A](implicit rds: Reads[A]): JsResult[A]

    Tries to convert the node into a JsResult[T] (Success or Error).

    Tries to convert the node into a JsResult[T] (Success or Error). An implicit Reads[T] must be defined.

    Definition Classes
    JsLookupResultJsReadable
  19. def validateOpt[A](implicit rds: Reads[A]): JsResult[Option[A]]

    If this result contains JsNull or is undefined, returns JsSuccess(None).

    If this result contains JsNull or is undefined, returns JsSuccess(None). Otherwise returns the result of validating as an A and wrapping the result in a Some.

    Definition Classes
    JsLookupResult
  20. val value: JsValue

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from JsLookupResult

Inherited from JsReadable

Inherited from AnyVal

Inherited from Any

Ungrouped