public enum LongSerializationPolicy extends Enum<LongSerializationPolicy>
long
or Long
type when its serialized.Enum Constant and Description |
---|
DEFAULT
This is the "default" serialization policy that will output a
long object as a JSON
number. |
STRING
Serializes a long value as a quoted string.
|
Modifier and Type | Method and Description |
---|---|
abstract JsonElement |
serialize(Long value)
Serialize this
value using this serialization policy. |
static LongSerializationPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LongSerializationPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LongSerializationPolicy DEFAULT
long
object as a JSON
number. For example, assume an object has a long field named "f" then the serialized output
would be:
{"f":123}
.public static final LongSerializationPolicy STRING
{"f":"123"}
.public static LongSerializationPolicy[] values()
for (LongSerializationPolicy c : LongSerializationPolicy.values()) System.out.println(c);
public static LongSerializationPolicy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract JsonElement serialize(Long value)
value
using this serialization policy.value
- the long value to be serialized into a JsonElement
value
Copyright © 2008–2015 Google, Inc.. All rights reserved.