Class NettyConverters

java.lang.Object
io.micronaut.http.server.netty.converters.NettyConverters
All Implemented Interfaces:
TypeConverterRegistrar

@Prototype @Internal public final class NettyConverters extends Object implements TypeConverterRegistrar
Factory for bytebuf related converters.
Since:
1.0
Author:
graemerocher
  • Constructor Details

  • Method Details

    • register

      public void register(MutableConversionService conversionService)
      Description copied from interface: TypeConverterRegistrar
      Interface for registrars of TypeConverter instances.
      Specified by:
      register in interface TypeConverterRegistrar
      Parameters:
      conversionService - The ConversionService
    • refCountAwareConvert

      public static <T> Optional<T> refCountAwareConvert(ConversionService service, io.netty.util.ReferenceCounted input, ArgumentConversionContext<T> context)
      This method converts a netty reference counted object and transfers release ownership to the new object.
      Type Parameters:
      T - Target type
      Parameters:
      service - The conversion service
      context - The context to convert to
      input - The object to convert
      Returns:
      The converted object
    • refCountAwareConvert

      public static <T> Optional<T> refCountAwareConvert(ConversionService service, io.netty.util.ReferenceCounted input, Class<T> targetType, ConversionContext context)
      This method converts a netty reference counted object and transfers release ownership to the new object.
      Type Parameters:
      T - Target type
      Parameters:
      service - The conversion service
      input - The object to convert
      targetType - The type to convert to
      context - The context to convert with
      Returns:
      The converted object