Class HttpAuthHeaders
java.lang.Object
org.apache.pulsar.client.api.v5.auth.HttpAuthHeaders
HTTP authentication headers an implementation produces for an outgoing request (and, for
challenge/response, the headers carrying a server's challenge) (PIP-478).
Header names are canonicalised on construction (RFC 7230 ยง3.2 treats them case-insensitively);
get(String) is case-insensitive; asMap() returns a stable canonical-cased view.
Single value per name. This collapses to one value per canonical name: when the source map
passed to of(Map) holds two entries that canonicalise to the same name (case-variants such as
Authorization and authorization), the one visited last in the source map's iteration
order wins. Multi-valued headers are not represented.
-
Method Summary
Modifier and TypeMethodDescriptionasMap()static HttpAuthHeadersempty()Look up a header value, case-insensitively.booleanisEmpty()static HttpAuthHeadersCreate headers with a single entry.static HttpAuthHeadersCreate headers from a map.toString()
-
Method Details
-
empty
- Returns:
- a shared empty instance
-
of
Create headers with a single entry.- Parameters:
name- the header namevalue- the header value- Returns:
- a new
HttpAuthHeaders
-
of
Create headers from a map. Names are canonicalised; two source entries that canonicalise to the same name (case-variants) collapse to one, and the entry visited last inheaders' iteration order wins.- Parameters:
headers- the source headers (names canonicalised)- Returns:
- a new
HttpAuthHeaders
-
get
-
asMap
-
isEmpty
public boolean isEmpty()- Returns:
trueif there are no headers
-
toString
-