Class GenericHeaderCodec

All Implemented Interfaces:
HeaderCodec<GenericHeader>

public class GenericHeaderCodec extends AbstractHeaderCodec<GenericHeader,GenericHeader.Builder>

Genric HTTP HeaderCodec implementation.

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

    • GenericHeaderCodec

      protected GenericHeaderCodec()

      Creates a generic HTTP header codec.

  • Method Details

    • decode

      public GenericHeader decode(String name, String value)
      Description copied from interface: HeaderCodec

      Decodes the specified raw header value for the specified header name.

      Parameters:
      name - a header name
      value - a header raw value
      Returns:
      a decoded header instance
    • decode

      public GenericHeader decode(String name, io.netty.buffer.ByteBuf buffer, Charset charset)
      Description copied from interface: HeaderCodec

      Decodes the specified raw value ByteBuf for the specified header name using the specified charset.

      Parameters:
      name - a header name
      buffer - a header raw value
      charset - the charset to use for decoding
      Returns:
      a decoded header instance
    • encode

      public String encode(GenericHeader headerField)
      Description copied from interface: HeaderCodec

      Encodes the specified header as a string.

      The resulting value is a header field as defined by RFC 7230 Section 3.2.

      Parameters:
      headerField - the header to encode
      Returns:
      the encoded header
    • encodeValue

      public String encodeValue(GenericHeader headerField)
      Description copied from interface: HeaderCodec

      Encodes the value of the specified header as a string.

      The resulting value corresponds to the header field value as defined by RFC 7230 Section 3.2.

      Parameters:
      headerField - the header to encode
      Returns:
      the encoded header value