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 TypeMethodDescriptionboolean
isEmpty
(Serializer.EncoderContext context, Object[] value) Used forJsonInclude.Include#NON_EMPTY
checking.void
serialize
(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, wait
Methods 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:Serializer
Serializes the given value using the passedEncoder
.- Specified by:
serialize
in interfaceSerializer<Object[]>
- Parameters:
encoder
- The encoder to usecontext
- The encoder context, nevernull
type
- Models the generic type of the valuevalue
- The value, can benull
- Throws:
IOException
- If an error occurs during serialization
-
isEmpty
Description copied from interface:Serializer
Used forJsonInclude.Include#NON_EMPTY
checking.- Specified by:
isEmpty
in interfaceSerializer<Object[]>
- Parameters:
context
- The encoder contextvalue
- The check to check- Returns:
- Return
true
if the value is empty
-