Class CustomizedObjectArraySerializer
java.lang.Object
io.micronaut.serde.support.serdes.CustomizedObjectArraySerializer
- All Implemented Interfaces:
Serializer<Object[]>
Deserializer for object arrays.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext -
Constructor Summary
ConstructorsConstructorDescriptionCustomizedObjectArraySerializer(io.micronaut.core.type.Argument<Object> componentType, Serializer<Object> componentSerializer) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty(Serializer.EncoderContext context, Object[] value) Used forJsonInclude.Include#NON_EMPTYchecking.voidserialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object[]> type, Object[] value) Serializes the given value using the passedEncoder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.serde.Serializer
createSpecific, isAbsent, isDefault
-
Constructor Details
-
CustomizedObjectArraySerializer
public CustomizedObjectArraySerializer(io.micronaut.core.type.Argument<Object> componentType, Serializer<Object> componentSerializer)
-
-
Method Details
-
serialize
public void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object[]> type, Object[] value) throws IOException Description copied from interface:SerializerSerializes the given value using the passedEncoder.- Specified by:
serializein interfaceSerializer<Object[]>- Parameters:
encoder- The encoder to usecontext- The encoder context, nevernulltype- Models the generic type of the valuevalue- The value, can benull- Throws:
IOException- If an error occurs during serialization
-
isEmpty
Description copied from interface:SerializerUsed forJsonInclude.Include#NON_EMPTYchecking.- Specified by:
isEmptyin interfaceSerializer<Object[]>- Parameters:
context- The encoder contextvalue- The check to check- Returns:
- Return
trueif the value is empty
-