Packages

o

org.coursera.naptime.courier

CourierSerializer

object CourierSerializer

Provides methods for serializing and deserializing the Pegasus data types used by Courier to JSON.

This uses org.coursera.pegasus.TypedDefinitionCodec, the default codec for use with Courier at Coursera.

For example, given a generated Courier data binding class named Profile, to serialize the Courier data binding class (a.k.a. data template) to JSON:

val profile = Profile(...) val jsonString = CourierSerializer.write(profile)

And to Deserialize JSON to the Courier data binding:

val profile = CourierSerializer.read[Profile](jsonString)

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CourierSerializer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class TemplateBuilder[T <: DataTemplate[_ <: AnyRef]] extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def builder[T <: DataTemplate[_ <: AnyRef]](clazz: Class[T]): TemplateBuilder[T]
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def getDeclaringTyperefSchema[T <: DataTemplate[_]](implicit clazz: Class[T]): Option[TyperefDataSchema]

    For unions declared in a typeref, gets the typeref schema.

  12. def getSchema[T <: DataTemplate[_]](implicit clazz: Class[T]): DataSchema
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. def read[T <: DataTemplate[DataMap]](json: String)(implicit tag: ClassTag[T]): T

    Reads a record template from a JSON string.

    Reads a record template from a JSON string.

    Exceptions thrown

    org.coursera.courier.templates.DataValidationException if validation fails.

  19. def readUnion[T <: UnionTemplate](json: String)(implicit tag: ClassTag[T]): T

    Reads a union template from a JSON string.

    Reads a union template from a JSON string.

    Exceptions thrown

    org.coursera.courier.templates.DataValidationException if validation fails.

  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  25. def write[T <: DataTemplate[DataMap]](template: T)(implicit tag: ClassTag[T]): String
  26. def writeUnion[T <: UnionTemplate](template: T)(implicit tag: ClassTag[T]): String

Inherited from AnyRef

Inherited from Any

Ungrouped