Class TextByteBufMediaTypeConverter

java.lang.Object
io.inverno.mod.base.converter.ByteBufConverter
io.inverno.mod.boot.converter.TextByteBufMediaTypeConverter
All Implemented Interfaces:
Converter<ByteBuf,Object>, Decoder<ByteBuf,Object>, Encoder<Object,ByteBuf>, JoinableEncoder<Object,ByteBuf>, JoinablePrimitiveEncoder<ByteBuf>, MediaTypeConverter<ByteBuf>, ObjectConverter<ByteBuf>, PrimitiveDecoder<ByteBuf>, PrimitiveEncoder<ByteBuf>, ReactiveConverter<ByteBuf,Object>, ReactiveDecoder<ByteBuf,Object>, ReactiveEncoder<Object,ByteBuf>, SplittableDecoder<ByteBuf,Object>, SplittablePrimitiveDecoder<ByteBuf>

public class TextByteBufMediaTypeConverter extends ByteBufConverter implements MediaTypeConverter<ByteBuf>

ByteBuf text/plain media type converter.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Constructor Details

    • TextByteBufMediaTypeConverter

      public TextByteBufMediaTypeConverter(ObjectConverter<String> stringConverter)

      Creates a text/plain media type converter.

      Parameters:
      stringConverter - the underlying String converter
  • Method Details

    • canConvert

      public boolean canConvert(String mediaType)
      Description copied from interface: MediaTypeConverter

      Determines whether the converter can convert the specified media type.

      Specified by:
      canConvert in interface MediaTypeConverter<ByteBuf>
      Parameters:
      mediaType - a media type
      Returns:
      true if the converter can convert the media type, false otherwise
    • decodeMany

      public <T> Flux<T> decodeMany(Publisher<ByteBuf> value, Type type)
      Description copied from interface: ReactiveDecoder

      Decodes the specified stream of values whose type is the specified type into a flux stream of values.

      Specified by:
      decodeMany in interface ReactiveDecoder<ByteBuf,Object>
      Overrides:
      decodeMany in class ByteBufConverter
      Type Parameters:
      T - the type of the decoded object
      Parameters:
      value - the stream of values to decode
      type - the type of the decoded object
      Returns:
      a flux emitting the decoded values