public final class OptionalSerializerExtension extends java.lang.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 |
|---|---|
java.util.Optional<Serializer> |
getSerializer(javax.lang.model.type.TypeMirror typeMirror,
SerializerFactory factory,
javax.annotation.processing.ProcessingEnvironment processingEnv)
Creates a
Serializer that supports Optional types. |
public java.util.Optional<Serializer> getSerializer(javax.lang.model.type.TypeMirror typeMirror, SerializerFactory factory, javax.annotation.processing.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 © 2020 Google LLC. All Rights Reserved.