T
- public abstract class AbstractBsonSerde<T> extends java.lang.Object implements NullableSerde<T>
Serializer.EncoderContext
Deserializer.DecoderContext
Constructor and Description |
---|
AbstractBsonSerde() |
Modifier and Type | Method and Description |
---|---|
T |
deserializeNonNull(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super T> type)
A method that is invoked when the value is known not to be null.
|
protected abstract T |
doDeserializeNonNull(BsonReaderDecoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super T> type) |
protected abstract void |
doSerialize(BsonWriterEncoder encoder,
Serializer.EncoderContext context,
T value,
io.micronaut.core.type.Argument<? extends T> type) |
void |
serialize(Encoder encoder,
Serializer.EncoderContext context,
io.micronaut.core.type.Argument<? extends T> type,
T value)
Serializes the given value using the passed
Encoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, isAbsent, isEmpty
allowNull, deserialize
createSpecific, getDefaultValue
protected abstract T doDeserializeNonNull(BsonReaderDecoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws java.io.IOException
java.io.IOException
protected abstract void doSerialize(BsonWriterEncoder encoder, Serializer.EncoderContext context, T value, io.micronaut.core.type.Argument<? extends T> type) throws java.io.IOException
java.io.IOException
public final T deserializeNonNull(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws java.io.IOException
NullableDeserializer
deserializeNonNull
in interface NullableDeserializer<T>
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserializationpublic final void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws java.io.IOException
Serializer
Encoder
.serialize
in interface Serializer<T>
encoder
- The encoder to usecontext
- The encoder context, never null
type
- Models the generic type of the valuevalue
- The value, can be null
java.io.IOException
- If an error occurs during serialization