Class ReadOnlyHttpHeaders

java.lang.Object
io.netty.handler.codec.http.HttpHeaders
io.netty.handler.codec.http.ReadOnlyHttpHeaders
All Implemented Interfaces:
Iterable<Map.Entry<String,String>>

@UnstableApi public final class ReadOnlyHttpHeaders extends HttpHeaders
A variant of HttpHeaders which only supports read-only methods.

Any array passed to this class may be used directly in the underlying data structures of this class. If these arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.

This may be a good alternative to DefaultHttpHeaders if your have a fixed set of headers which will not change.

  • Constructor Details

    • ReadOnlyHttpHeaders

      public ReadOnlyHttpHeaders(boolean validateHeaders, CharSequence... nameValuePairs)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate the contents of each header name and value.
      nameValuePairs - An array of the structure [<name,value>,<name,value>,...]. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.
  • Method Details