Class HashHeaders

java.lang.Object
io.helidon.common.http.HashParameters
io.helidon.common.http.HashHeaders
All Implemented Interfaces:
Headers, Parameters, Iterable<Map.Entry<String,List<String>>>
Direct Known Subclasses:
WriteableBodyPartHeaders

public class HashHeaders extends HashParameters implements Headers
A Map-based Headers implementation with case-insensitive keys and immutable List of values that needs to be copied on each write.
  • Constructor Details

    • HashHeaders

      protected HashHeaders()
      Creates a new empty instance.
    • HashHeaders

      protected HashHeaders(Map<String,List<String>> initialContent)
      Creates a new instance populated from the contents of the provided multi-map.
      Parameters:
      initialContent - multi-map containing the initial contents to populate the new instance
    • HashHeaders

      protected HashHeaders(Iterable<Map.Entry<String,List<String>>> initialContent)
      Creates a new instance populated from the given contents, typically from another HashHeaders instance or a map's entry set.
      Parameters:
      initialContent - initial data
  • Method Details

    • create

      public static HashHeaders create()
      Creates a new, empty instance.
      Returns:
      empty instance
    • create

      public static HashHeaders create(Map<String,List<String>> initialContent)
      Creates a new instance populated with the specified multi-map's contents.
      Parameters:
      initialContent - multi-map containing initial contents for the new instance
      Returns:
      new instance filled with a deep copy of the initial contents
    • create

      public static HashHeaders create(Parameters initialContent)
      Creates a new instance populated with the specified Parameters contents.
      Parameters:
      initialContent - Parameters containing initial contents for the new instance
      Returns:
      new instance filled with the names and values of the specified initial contents
    • concat

      public static HashHeaders concat(Parameters... parameters)
      Concatenates the contents of the specified Parameters into a new HashHeaders instance.
      Parameters:
      parameters - zero or more Parameters instances
      Returns:
      new HashHeaders containing the names and values from the specified initial parameters
    • concat

      public static HashHeaders concat(Iterable<Parameters> initialContent)
      Concatenates the specified contents into a new HashHeaders instance.
      Parameters:
      initialContent - zero or more Parameters instances
      Returns:
      new HashHeaders containint the names and values from the specified initial content
    • emptyMapForReads

      protected Map<String,List<String>> emptyMapForReads()
      Description copied from class: HashParameters
      Returns an empty Map suitable for case-sensitivity or case-insensitivity and optimized for read-only access.

      Typical implementations should not return a concurrent implementation.

      Overrides:
      emptyMapForReads in class HashParameters
      Returns:
      empty Map implementation with correct case-sensitivity behavior and optimized for read-only access
    • emptyMapForUpdates

      protected ConcurrentMap<String,List<String>> emptyMapForUpdates()
      Description copied from class: HashParameters
      Returns an empty Map suitable for case-sensitivity or case-insensitivity and for read-write access.

      Typical implementations should return a concurrent implementation.

      Overrides:
      emptyMapForUpdates in class HashParameters
      Returns:
      empty Map implementation with correct case-sensitivity behavior and suitable for read-write access