object KeyFormat extends PrimitiveFormats
- Alphabetic
- By Inheritance
- KeyFormat
- PrimitiveFormats
- 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
- val ID_FIELD: String
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
caseClassFormat[K, L](apply: (L) ⇒ K, unapply: (K) ⇒ Option[L])(implicit delegateFormat: KeyFormat[L]): KeyFormat[K]
Conveniently construct a format for a
case classtype.Conveniently construct a format for a
case classtype.For example:
case class StorageKey(distributionKey: String, sortKey: String) object StorageKey { implicit val keyFormat: KeyFormat[StorageKey] = KeyFormat.caseClass((apply _).tupled, unapply) }
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
idAsPrimitive[K, P](apply: (P) ⇒ K, unapply: (K) ⇒ Option[P])(implicit primitiveFormat: KeyFormat[P]): KeyFormat[K]
Defines a format that only adds the
"id"field to response objects.Defines a format that only adds the
"id"field to response objects. The"id"field will contain the natural JSON representation for primitive typeP. (JSON number forInt, etc.) -
def
idAsStringOnly[K](implicit stringKeyFormatT: StringKeyFormat[K]): KeyFormat[K]
Defines a
KeyFormatthat only adds the"id"field to response objects.Defines a
KeyFormatthat only adds the"id"field to response objects. The"id"field will contain a string representation of the id, as specified bystringKeyFormatT.Note: If
Kcontains a single, primitive type field (likecase class A(i: Int)), you may want to use idAsPrimitive instead. With idAsStringOnly, the output object will be{"id": "3"}, whereas with idAsPrimitive, it'll be{"id": 3}.Note: If you want to add additional fields to JSON response objects (for example, if
Kis a composite key), use idAsStringWithFields instead. -
def
idAsStringWithFields[K](idWrites: OWrites[K])(implicit stringKeyFormat: StringKeyFormat[K]): KeyFormat[K]
Defines a
KeyFormatthat adds the"id"field to response objects as well as others returned byidWrites.Defines a
KeyFormatthat adds the"id"field to response objects as well as others returned byidWrites. Use this for composite id types where clients should have access to parts of the id in addition to the whole opaque string.See idAsStringOnly.
-
implicit
val
intKeyFormat: KeyFormat[Int]
- Definition Classes
- PrimitiveFormats
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
implicit
val
longKeyFormat: KeyFormat[Long]
- Definition Classes
- PrimitiveFormats
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
implicit
val
stringKeyFormat: KeyFormat[String]
- Definition Classes
- PrimitiveFormats
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
implicit
val
uuidKeyFormat: KeyFormat[UUID]
- Definition Classes
- PrimitiveFormats
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withFallbackReads[K](altReads: Reads[K])(keyFormat: KeyFormat[K]): KeyFormat[K]
Augment
K's format with an additional fallback JsReads implementation.Augment
K's format with an additional fallback JsReads implementation.- K
The key type.
- altReads
An alternate JsValue to
KReads implementation.- keyFormat
The standard KeyFormat to augment.
- returns
The augmented KeyFormat.