com.paypal.cascade.examples.common

enumeration

package enumeration

Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class MyEnum extends Enumeration

    An example implementation of Enumeration.

    An example implementation of Enumeration.

    For a given Enumeration, @JsonSerialize and @JsonDeserialize annotations must be set, and JsonSerializer/JsonDeserializer classes need to be provided for those annotations.

    Luckily, most enumeration serializers and deserializers can be copied verbatim from this example, changing type parameters where needed. Delicious boilerplate.

    Annotations
    @JsonSerialize() @JsonDeserialize()

Value Members

  1. object MyEnum extends Serializable

    Each Enumeration is implemented as a series of case objects extending a base abstract class, that itself extends Enumeration.

    Each Enumeration is implemented as a series of case objects extending a base abstract class, that itself extends Enumeration. Each case object must override stringVal, and the stringVal for each should be unique across all cases of a given Enumeration; no two objects should have the same stringVal value, regardless of uppercase/lowercase.

  2. object MyEnumRunner extends LoggingSugar

    A simple example runner, demonstrating how to serialize and deserialize objects with Enumerations.

    A simple example runner, demonstrating how to serialize and deserialize objects with Enumerations. The toJson and fromJson calls are from implicits in

    com.paypal.cascade.json._

    .

    com.paypal.cascade.json._ }}}

Ungrouped