| java.lang.Object | ||
| ↳ | java.lang.Enum<E extends java.lang.Enum<E>> | |
| ↳ | com.google.gson.LongSerializationPolicy | |
Defines the expected format for a long or Long type when its serialized.
| Enum Values | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| LongSerializationPolicy | DEFAULT | This is the "default" serialization policy that will output a long object as a JSON
number. |
|||||||||
| LongSerializationPolicy | STRING | Serializes a long value as a quoted string. | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract JsonElement |
serialize(Long value)
Serialize this
value using this serialization policy. | ||||||||||
| static LongSerializationPolicy | valueOf(String name) | ||||||||||
| final static LongSerializationPolicy[] | values() | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Enum
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
| |||||||||||
This is the "default" serialization policy that will output a 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}.
Serializes a long value as a quoted string. For example, assume an object has a long field
named "f" then the serialized output would be:
{"f":"123"}.
Serialize this value using this serialization policy.
| value | the long value to be serialized into a JsonElement |
|---|
value