@AutoService(value=SerializerExtension.class) public final class OptionalSerializerExtension extends Object implements SerializerExtension
SerializerExtension that enables Optional types to be serialized.
The type argument T of Optional<T> is queried against the SerializerFactory.
| Constructor and Description |
|---|
OptionalSerializerExtension() |
| Modifier and Type | Method and Description |
|---|---|
Optional<Serializer> |
getSerializer(TypeMirror typeMirror,
SerializerFactory factory,
ProcessingEnvironment processingEnv)
Creates a
Serializer that supports Optional types. |
public Optional<Serializer> getSerializer(TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv)
Serializer that supports Optional types.getSerializer in interface SerializerExtensiontypeMirror - the type being serializedfactory - a SerializerFactory that can be used to serialize nested typesprocessingEnv - the processing environment provided by the annotation processing frameworkCopyright © 2022 Google LLC. All rights reserved.