Class OptionalObjectSerializer<T extends java.util.Optional<?>>
- java.lang.Object
-
- org.eclipse.yasson.internal.serializer.OptionalObjectSerializer<T>
-
- Type Parameters:
T
- instantiated Optional type
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbSerializer<T>
,RuntimeTypeInfo
,CurrentItem<T>
public class OptionalObjectSerializer<T extends java.util.Optional<?>> extends java.lang.Object implements CurrentItem<T>, javax.json.bind.serializer.JsonbSerializer<T>
Common serializer logic for java Optionals.
-
-
Constructor Summary
Constructors Constructor Description OptionalObjectSerializer(SerializerBuilder builder)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassModel
getClassModel()
Class model containing property for this item.Customization
getCustomization()
java.lang.reflect.Type
getRuntimeType()
Returns a runtime type.CurrentItem<?>
getWrapper()
Item wrapper.void
serialize(T obj, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
-
-
-
Constructor Detail
-
OptionalObjectSerializer
public OptionalObjectSerializer(SerializerBuilder builder)
Creates a new instance.- Parameters:
builder
- Builder to initialize the instance.
-
-
Method Detail
-
getClassModel
public ClassModel getClassModel()
Description copied from interface:CurrentItem
Class model containing property for this item.- Specified by:
getClassModel
in interfaceCurrentItem<T extends java.util.Optional<?>>
- Returns:
- Class model.
-
getWrapper
public CurrentItem<?> getWrapper()
Description copied from interface:CurrentItem
Item wrapper. Null only in case of a root item.- Specified by:
getWrapper
in interfaceCurrentItem<T extends java.util.Optional<?>>
- Specified by:
getWrapper
in interfaceRuntimeTypeInfo
- Returns:
- Wrapper item of this item.
-
getRuntimeType
public java.lang.reflect.Type getRuntimeType()
Description copied from interface:RuntimeTypeInfo
Returns a runtime type. It can be a class,ParameterizedType
orTypeVariable
.- Specified by:
getRuntimeType
in interfaceRuntimeTypeInfo
- Returns:
- Runtime type or null if not defined.
-
getCustomization
public Customization getCustomization()
-
-