SerializerExtension that enables Optional types to be serialized.
The type argument T of Optional<T> is queried against the SerializerFactory.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static javax. | |
| public Optional | getSerializer(javax.
the type being serialized typeMirror,a factory, javax.SerializerFactory that can be used to serialize nested typesthe processing environment provided by the annotation processing framework processingEnvImplements com. Creates a |
| private static boolean |
| OptionalSerializerExtension | back to summary |
|---|---|
| public OptionalSerializerExtension() | |
| getContainedType | back to summary |
|---|---|
| private static javax. Gets the given type's first type argument. Returns the | |
| getSerializer | back to summary |
|---|---|
| public Optional Implements com. Creates a
| |
| isOptional | back to summary |
|---|---|
| private static boolean isOptional(javax. Checks if the given type is an | |
| Modifier and Type | Field and Description |
|---|---|
| private final Serializer |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public CodeBlock | fromProxy(CodeBlock expression)
Implements com. Creates an expression that converts the proxy type back to the original type. |
| public javax. | proxyFieldType()
Implements com. The proxy type the original unserializable type will be mapped to. |
| public CodeBlock | toProxy(CodeBlock expression)
Implements com. Creates an expression that converts the original type to the proxy type. |
| containedTypeSerializer | back to summary |
|---|---|
| private final Serializer containedTypeSerializer | |
| OptionalSerializer | back to summary |
|---|---|
| pack-priv OptionalSerializer(Serializer containedTypeSerializer) | |
| fromProxy | back to summary |
|---|---|
| public CodeBlock fromProxy(CodeBlock expression) Implements com. Doc from com. Creates an expression that converts the proxy type back to the original type.
| |
| proxyFieldType | back to summary |
|---|---|
| public javax. Implements com. Doc from com. The proxy type the original unserializable type will be mapped to.
| |
| toProxy | back to summary |
|---|---|
| public CodeBlock toProxy(CodeBlock expression) Implements com. Doc from com. Creates an expression that converts the original type to the proxy type.
| |