public enum LongSerializationPolicy extends java.lang.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(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 JsonElement
value
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"