Object

org.coursera.naptime.courier

CourierSerializer

Related Doc: package courier

Permalink

object CourierSerializer

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

This uses 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

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def builder[T <: DataTemplate[_ <: AnyRef]](clazz: Class[T]): TemplateBuilder[T]

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def getDeclaringTyperefSchema[T <: DataTemplate[_]](implicit clazz: Class[T]): Option[TyperefDataSchema]

    Permalink

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

  12. def getSchema[T <: DataTemplate[_]](implicit clazz: Class[T]): DataSchema

    Permalink
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def read[T <: DataTemplate[DataMap]](json: String)(implicit tag: ClassTag[T]): T

    Permalink

    Reads a record template from a JSON string.

    Reads a record template from a JSON string.

    Exceptions thrown

    DataValidationException if validation fails.

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

    Permalink

    Reads a union template from a JSON string.

    Reads a union template from a JSON string.

    Exceptions thrown

    DataValidationException if validation fails.

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def write[T <: DataTemplate[DataMap]](template: T)(implicit tag: ClassTag[T]): String

    Permalink
  26. def writeUnion[T <: UnionTemplate](template: T)(implicit tag: ClassTag[T]): String

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped