java.io.Serializable, java.lang.Comparable<LongSerializationPolicy>public enum LongSerializationPolicy extends java.lang.Enum<LongSerializationPolicy>
long or Long type when its serialized.| Enum Constant | 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 | Description |
|---|---|---|
abstract JsonElement |
serialize(java.lang.Long value) |
Serialize this
value using this serialization policy. |
static LongSerializationPolicy |
valueOf(java.lang.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(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic abstract JsonElement serialize(java.lang.Long value)
value using this serialization policy.value - the long value to be serialized into a JsonElementvalueCopyright © 2018. All rights reserved.