Class ByteBufferSerde
java.lang.Object
io.micronaut.serde.support.serdes.ByteBufferSerde
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,Deserializer<ByteBuffer>
,Serde<ByteBuffer>
,Serializer<ByteBuffer>
,DeserializerRegistrar<ByteBuffer>
,SerdeRegistrar<ByteBuffer>
,SerializerRegistrar<ByteBuffer>
Serde
implementation of ByteBuffer
.
This is a based on `com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer` which is licenced under the Apache 2.0 licence.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Deserializer
Deserializer.DecoderContext
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable ByteBuffer
deserialize
(@NonNull Decoder decoder, @NonNull Deserializer.DecoderContext context, @NonNull io.micronaut.core.type.Argument<? super ByteBuffer> type) Deserializes from the current state of theDecoder
an object of typeDeserializer
.io.micronaut.core.type.Argument<ByteBuffer>
getType()
void
serialize
(@NonNull Encoder encoder, @NonNull Serializer.EncoderContext context, @NonNull io.micronaut.core.type.Argument<? extends ByteBuffer> type, @NonNull ByteBuffer 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.Deserializer
allowNull, createSpecific, deserializeNullable, getDefaultValue
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
Methods inherited from interface io.micronaut.serde.support.SerdeRegistrar
getTypes
Methods inherited from interface io.micronaut.serde.Serializer
createSpecific, isAbsent, isEmpty
-
Constructor Details
-
ByteBufferSerde
public ByteBufferSerde()
-
-
Method Details
-
deserialize
@Nullable public @Nullable ByteBuffer deserialize(@NonNull @NonNull Decoder decoder, @NonNull @NonNull Deserializer.DecoderContext context, @NonNull @NonNull io.micronaut.core.type.Argument<? super ByteBuffer> type) throws IOException Description copied from interface:Deserializer
Deserializes from the current state of theDecoder
an object of typeDeserializer
.- Specified by:
deserialize
in interfaceDeserializer<ByteBuffer>
- Parameters:
decoder
- The decoder, nevernull
context
- The decoder context, nevernull
type
- The generic type to be deserialized- Returns:
- The deserialized object or
null
only ifDeserializer.allowNull()
returnstrue
- Throws:
IOException
- If an error occurs during deserialization of the object
-
serialize
public void serialize(@NonNull @NonNull Encoder encoder, @NonNull @NonNull Serializer.EncoderContext context, @NonNull @NonNull io.micronaut.core.type.Argument<? extends ByteBuffer> type, @NonNull @NonNull ByteBuffer value) throws IOException Description copied from interface:Serializer
Serializes the given value using the passedEncoder
.- Specified by:
serialize
in interfaceSerializer<ByteBuffer>
- 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
-
getType
- Specified by:
getType
in interfaceDeserializerRegistrar<ByteBuffer>
- Specified by:
getType
in interfaceSerdeRegistrar<ByteBuffer>
- Specified by:
getType
in interfaceSerializerRegistrar<ByteBuffer>
- Returns:
- The serde argument type
-