Class CustomizedObjectArraySerializer
java.lang.Object
io.micronaut.serde.support.serdes.CustomizedObjectArraySerializer
- All Implemented Interfaces:
Serializer<@Nullable Object[]>
public final class CustomizedObjectArraySerializer
extends Object
implements Serializer<@Nullable Object[]>
Deserializer for object arrays.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface 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 @Nullable [] value) Used forJsonInclude.Include#NON_EMPTYchecking.voidserialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object[]> type, @Nullable Object[] value) Serializes the given value using the passedEncoder.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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, @Nullable Object[] value) throws IOException Description copied from interface:SerializerSerializes the given value using the passedEncoder.- Specified by:
serializein interfaceSerializer<@Nullable Object[]>- Parameters:
encoder- The encoder to usecontext- The encoder context, nevernulltype- Models the generic type of the valuevalue- The value to serialize, nevernull. Callers should encode null values directly.- Throws:
IOException- If an error occurs during serialization
-
isEmpty
Description copied from interface:SerializerUsed forJsonInclude.Include#NON_EMPTYchecking.- Specified by:
isEmptyin interfaceSerializer<@Nullable Object[]>- Parameters:
context- The encoder contextvalue- The check to check- Returns:
- Return
trueif the value is empty
-