Package io.micronaut.protobuf.convert
Class ProtoMessageToByteBufConverter
java.lang.Object
io.micronaut.protobuf.convert.ProtoMessageToByteBufConverter
- All Implemented Interfaces:
io.micronaut.core.convert.TypeConverter<com.google.protobuf.Message,
io.netty.buffer.ByteBuf>
@Singleton
@Requires(classes={com.google.protobuf.Message.class,io.netty.buffer.ByteBuf.class})
public class ProtoMessageToByteBufConverter
extends Object
implements io.micronaut.core.convert.TypeConverter<com.google.protobuf.Message,io.netty.buffer.ByteBuf>
Converts Protocol buffer messages to Netty
ByteBuf
.- Author:
- graemerocher, luistrigueiros
-
Constructor Summary
ConstructorDescriptionProtoMessageToByteBufConverter
(io.micronaut.core.convert.ConversionService conversionService) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.convert.TypeConverter
convert
-
Constructor Details
-
ProtoMessageToByteBufConverter
public ProtoMessageToByteBufConverter(io.micronaut.core.convert.ConversionService conversionService) - Parameters:
conversionService
- The conversion service
-
-
Method Details
-
convert
public Optional<io.netty.buffer.ByteBuf> convert(com.google.protobuf.Message object, Class<io.netty.buffer.ByteBuf> targetType, io.micronaut.core.convert.ConversionContext context) - Specified by:
convert
in interfaceio.micronaut.core.convert.TypeConverter<com.google.protobuf.Message,
io.netty.buffer.ByteBuf>
-