Interface RequestHeaderContainer

All Known Implementing Classes:
DefaultRequestHeaderContainer

public interface RequestHeaderContainer
Represents an immutable container for multiple HTTP headers. These headers consist of a name and multiple values.
  • Field Details

  • Method Details

    • getHeaderNames

      @Nonnull List<String> getHeaderNames()
      Returns all unique names of the contained HTTP headers.

      Important: Casing of the individual names might be changed by the implementation. Duplicated names that differ only in their casing will be treated as a single name.

      Example: The header names HeaderA, HEADERA, and headera will result in only a single value being returned from this method.

      Note: Do not assume any specific casing of the returned header names. Also, do not use this method for determining whether a specific header is contained in this collection. Use containsHeader(String) instead.

      Returns:
      An immutable List of contained HTTP header names.
    • containsHeader

      boolean containsHeader(@Nonnull String headerName)
      Determines whether an HTTP header with the given headerName exists in this container. The headerName is treated case insensitively.
      Parameters:
      headerName - The name of the HTTP header to look for.
      Returns:
      true if an HTTP header with the given name is contained, false otherwise.
    • getHeaderValues

      @Nonnull List<String> getHeaderValues(@Nonnull String headerName)
      Returns a non-unique collection of individual values for an HTTP header with the given headerName. The headerName is treated case insensitively.
      Parameters:
      headerName - The name of the HTTP header to retrieve the values for.
      Returns:
      An immutable List of individual HTTP header values.
    • toBuilder

      @Nonnull RequestHeaderContainer.Builder toBuilder()
      Initializes a new instance of RequestHeaderContainer.Builder by copying all HTTP headers that are contained in this RequestHeaderContainer.
      Returns:
      A new instance of RequestHeaderContainer.Builder.