@Singleton public class ByteBufToObjectConverter extends Object implements TypeConverter<io.netty.buffer.ByteBuf,Object>
Constructor and Description |
---|
ByteBufToObjectConverter(ConversionService<?> conversionService) |
Modifier and Type | Method and Description |
---|---|
Optional<Object> |
convert(io.netty.buffer.ByteBuf object,
Class<Object> targetType,
ConversionContext context)
Converts from the given source object type to the target type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convert, of
public ByteBufToObjectConverter(ConversionService<?> conversionService)
conversionService
- The conversion servicepublic Optional<Object> convert(io.netty.buffer.ByteBuf object, Class<Object> targetType, ConversionContext context)
TypeConverter
Optional.empty()
in case the object is not convertible by catching any necessary exceptions and failing gracefully.convert
in interface TypeConverter<io.netty.buffer.ByteBuf,Object>
object
- The object typetargetType
- The target type being converted tocontext
- The ConversionContext