object OWrites extends PathWrites with ConstraintWrites
- Alphabetic
- By Inheritance
- OWrites
- ConstraintWrites
- PathWrites
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[A](f: (A) ⇒ JsObject): OWrites[A]
Returns an instance which uses
fas OWrites.writes function. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
at[A](path: JsPath)(implicit wrs: Writes[A]): OWrites[A]
- Definition Classes
- PathWrites
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- implicit val contravariantfunctorOWrites: ContravariantFunctor[OWrites]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- implicit val functionalCanBuildOWrites: FunctionalCanBuild[OWrites]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
jsPick(path: JsPath): Writes[JsValue]
- Definition Classes
- PathWrites
-
def
jsPickBranch(path: JsPath): OWrites[JsValue]
- Definition Classes
- PathWrites
-
def
jsPickBranchUpdate(path: JsPath, wrs: OWrites[JsValue]): OWrites[JsValue]
- Definition Classes
- PathWrites
-
def
list[A](implicit writes: Writes[A]): Writes[List[A]]
- Definition Classes
- ConstraintWrites
-
def
map[A](implicit writes: Writes[A]): OWrites[Map[String, A]]
- Definition Classes
- ConstraintWrites
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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.
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]
- Definition Classes
- PathWrites
- def of[A](implicit w: OWrites[A]): OWrites[A]
-
def
of[A](implicit w: Writes[A]): Writes[A]
- Definition Classes
- 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.writeNullablewhich omits the field when NonePure Option Writer[T] which writes "null" when None which is different from
JsPath.writeNullablewhich omits the field when None- Definition Classes
- ConstraintWrites
-
def
pruned[A]: Writes[A]
- Definition Classes
- ConstraintWrites
- def pure[A](fixed: ⇒ A)(implicit wrs: OWrites[A]): OWrites[JsValue]
-
def
pure[A](fixed: ⇒ A)(implicit wrs: Writes[A]): Writes[JsValue]
- Definition Classes
- ConstraintWrites
-
def
pure[A](path: JsPath, fixed: ⇒ A)(implicit wrs: Writes[A]): OWrites[JsValue]
- Definition Classes
- PathWrites
-
def
seq[A](implicit writes: Writes[A]): Writes[Seq[A]]
- Definition Classes
- ConstraintWrites
-
def
set[A](implicit writes: Writes[A]): Writes[Set[A]]
- Definition Classes
- ConstraintWrites
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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.
- w
the initial writer
- f
the transformer function
-
def
tuple2[A, B](name1: String, name2: String)(implicit arg0: Writes[A], arg1: Writes[B]): OWrites[(A, B)]
Writes a tuple of two values to a JSON object, with custom field names.
Writes a tuple of two values to a JSON object, with custom field names.
- A
the type of the first value
- B
the type of the second value
val tuple2Writes: OWrites[(String, Int)] = OWrites.tuple2[String, Int]("name", "age") tuple2Writes.writes("Bob" -> 30) // {"name":"Bob","age":30}
- name1
the name of the first field
- name2
the name of the second field
-
def
tuple3[A, B, C](name1: String, name2: String, name3: String)(implicit arg0: Writes[A], arg1: Writes[B], arg2: Writes[C]): OWrites[(A, B, C)]
Writes a tuple of three values to a JSON object, with custom field names.
Writes a tuple of three values to a JSON object, with custom field names.
- A
the type of the first value
- B
the type of the second value
- C
the type of the third value
val tuple3Writes: OWrites[(String, Int, Boolean)] = OWrites.tuple3[String, Int, Boolean]("name", "age", "isStudent") tuple3Writes.writes(("Bob", 30, false)) // {"name":"Bob","age":30,"isStudent":false}
- name1
the name of the first field
- name2
the name of the second field
- name3
the name of the third field
-
def
tuple4[A, B, C, D](name1: String, name2: String, name3: String, name4: String)(implicit arg0: Writes[A], arg1: Writes[B], arg2: Writes[C], arg3: Writes[D]): OWrites[(A, B, C, D)]
Writes a tuple of four values to a JSON object, with custom field names.
Writes a tuple of four values to a JSON object, with custom field names.
- A
the type of the first value
- B
the type of the second value
- C
the type of the third value
- D
the type of the fourth value
val tuple4Writes: OWrites[(String, Int, Boolean, Double)] = OWrites.tuple4[String, Int, Boolean, Double]("name", "age", "isStudent", "score") tuple4Writes.writes(("Bob", 30, false, 91.2)) // {"name":"Bob","age":30,"isStudent":false,"score":91.2}
- name1
the name of the first field
- name2
the name of the second field
- name3
the name of the third field
- name4
the name of the fourth field
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated
-
def
pruned[A](implicit w: Writes[A]): Writes[A]
- Definition Classes
- ConstraintWrites
- Annotations
- @deprecated
- Deprecated
(Since version 2.8.0) Use
prunedwithoutWrites[A]