Package io.micronaut.protobuf.convert
Class ByteBufToProtoMessageConverter
java.lang.Object
io.micronaut.protobuf.convert.ByteBufToProtoMessageConverter
- All Implemented Interfaces:
io.micronaut.core.convert.TypeConverter<io.netty.buffer.ByteBuf,
com.google.protobuf.Message>
@Singleton
@Requires(classes={com.google.protobuf.Message.class,io.netty.buffer.ByteBuf.class})
public class ByteBufToProtoMessageConverter
extends Object
implements io.micronaut.core.convert.TypeConverter<io.netty.buffer.ByteBuf,com.google.protobuf.Message>
Converts Protocol buffer messages from Netty
ByteBuf
.- Author:
- graemerocher, luistrigueiros
-
Constructor Details
-
ByteBufToProtoMessageConverter
Default constructor.- Parameters:
codec
- The codec
-
-
Method Details
-
convert
public Optional<com.google.protobuf.Message> convert(io.netty.buffer.ByteBuf object, Class<com.google.protobuf.Message> targetType, io.micronaut.core.convert.ConversionContext context) - Specified by:
convert
in interfaceio.micronaut.core.convert.TypeConverter<io.netty.buffer.ByteBuf,
com.google.protobuf.Message>
-