OWrites

play.api.libs.json.OWrites$
See theOWrites companion trait

Attributes

Companion
trait
Graph
Supertypes
trait PathWrites
class Object
trait Matchable
class Any
Self type
OWrites.type

Members list

Value members

Concrete methods

def apply[A](f: A => JsObject): OWrites[A]

Returns an instance which uses f as OWrites.writes function.

Returns an instance which uses f as OWrites.writes function.

Attributes

def of[A](implicit w: OWrites[A]): OWrites[A]
def pure[A](fixed: => A)(implicit wrs: OWrites[A]): OWrites[JsValue]
def transform[A](w: OWrites[A])(f: (A, JsObject) => JsObject): OWrites[A]

Transforms the resulting JsObject using the given function, which is also applied with the initial input.

Transforms the resulting JsObject using the given function, which is also applied with the initial input.

Value parameters

f

the transformer function

w

the initial writer

Attributes

Inherited methods

def at[A](path: JsPath)(implicit wrs: Writes[A]): OWrites[A]

Attributes

Inherited from:
PathWrites
def jsPick(path: JsPath): Writes[JsValue]

Attributes

Inherited from:
PathWrites

Attributes

Inherited from:
PathWrites

Attributes

Inherited from:
PathWrites
def list[A](implicit writes: Writes[A]): Writes[List[A]]

Attributes

Inherited from:
ConstraintWrites
def map[A](implicit writes: Writes[A]): OWrites[Map[String, A]]

Attributes

Inherited from:
ConstraintWrites
def nullable[A](path: JsPath)(implicit wrs: Writes[A]): OWrites[Option[A]]

writes a optional field in given JsPath : if None, doesn't write field at all. Please note we do not write "null" but simply omit the field when None If you want to write a "null", use ConstraintWrites.optionWithNull[A]

writes a optional field in given JsPath : if None, doesn't write field at all. Please note we do not write "null" but simply omit the field when None If you want to write a "null", use ConstraintWrites.optionWithNull[A]

Attributes

Inherited from:
PathWrites
def of[A](implicit w: Writes[A]): Writes[A]

Attributes

Inherited from:
ConstraintWrites
def optionWithNull[A](implicit wa: Writes[A]): Writes[Option[A]]

Pure Option Writer[T] which writes "null" when None which is different from JsPath.writeNullable which omits the field when None

Pure Option Writer[T] which writes "null" when None which is different from JsPath.writeNullable which omits the field when None

Attributes

Inherited from:
ConstraintWrites
def pruned[A]: Writes[A]

Attributes

Inherited from:
ConstraintWrites
def pure[A](fixed: => A)(implicit wrs: Writes[A]): Writes[JsValue]

Attributes

Inherited from:
ConstraintWrites
def pure[A](path: JsPath, fixed: => A)(implicit wrs: Writes[A]): OWrites[JsValue]

Attributes

Inherited from:
PathWrites
def seq[A](implicit writes: Writes[A]): Writes[Seq[A]]

Attributes

Inherited from:
ConstraintWrites
def set[A](implicit writes: Writes[A]): Writes[Set[A]]

Attributes

Inherited from:
ConstraintWrites

Deprecated and Inherited methods

def pruned[A](implicit w: Writes[A]): Writes[A]

Attributes

Deprecated
true
Inherited from:
ConstraintWrites

Implicits

Implicits

implicit val contravariantfunctorOWrites: ContravariantFunctor[OWrites]
implicit val functionalCanBuildOWrites: FunctionalCanBuild[OWrites]