- All Known Subinterfaces:
Http.HeaderValueWriteable
- All Known Implementing Classes:
ContentDisposition
- Enclosing class:
Http
public static interface Http.HeaderValue
HTTP Header with
Http.HeaderName and value.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAll values of this header.allValues(boolean split) All values of this header.booleanchanging()Changing headers should not be cached, and their value should not be indexed (HTTP/2).static Http.HeaderValuecreate(Http.HeaderName name, boolean changing, boolean sensitive, String... values) Create a new header.static Http.HeaderValuecreate(Http.HeaderName name, LazyString value) Create a new header with a single value.static Http.HeaderValuecreate(Http.HeaderName name, String value) Create a new header with a single value.static Http.HeaderValuecreate(Http.HeaderName name, String... values) Create a new header.static Http.HeaderValuecreate(Http.HeaderName name, List<String> values) Create a new header.static Http.HeaderValuecreateCached(Http.HeaderName name, boolean changing, boolean sensitive, String value) Create and cache byte value.static Http.HeaderValuecreateCached(Http.HeaderName name, String value) Create and cache byte value.Header name for the header.name()Name of the header as configured by user or as received on the wire.booleanSensitive headers should not be logged, or indexed (HTTP/2).value()First value of this header.<T> TValue mapped using aMapperManager.default byte[]Cached bytes of a single valued header's value.intNumber of values this header has.default Stringvalues()All values concatenated using a comma.default voidwriteHttp1Header(BufferData buffer) Write the current header as an HTTP header to the provided buffer.
-
Method Details
-
createCached
Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.- Parameters:
name- header namevalue- value of the header- Returns:
- a new header
-
create
Create a new header with a single value. This header is considered unchanging and not sensitive.- Parameters:
name- name of the headervalue- lazy string with the value- Returns:
- a new header
- See Also:
-
create
Create a new header with a single value. This header is considered unchanging and not sensitive.- Parameters:
name- name of the headervalue- value of the header- Returns:
- a new header
- See Also:
-
create
Create a new header. This header is considered unchanging and not sensitive.- Parameters:
name- name of the header*values- values of the header- Returns:
- a new header
- See Also:
-
create
Create a new header. This header is considered unchanging and not sensitive.- Parameters:
name- name of the headervalues- values of the header- Returns:
- a new header
- See Also:
-
createCached
static Http.HeaderValue createCached(Http.HeaderName name, boolean changing, boolean sensitive, String value) Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.- Parameters:
name- header namechanging- whether the value is changing often (to disable caching for HTTP/2)sensitive- whether the value is sensitive (to disable caching for HTTP/2)value- value of the header- Returns:
- a new header
-
create
static Http.HeaderValue create(Http.HeaderName name, boolean changing, boolean sensitive, String... values) Create a new header.- Parameters:
name- name of the headerchanging- whether the value is changing often (to disable caching for HTTP/2)sensitive- whether the value is sensitive (to disable caching for HTTP/2)values- value(s) of the header- Returns:
- a new header
-
name
String name()Name of the header as configured by user or as received on the wire.- Returns:
- header name, always lower case for HTTP/2 headers
-
headerName
Http.HeaderName headerName()Header name for the header.- Returns:
- header name
-
value
String value()First value of this header.- Returns:
- the first value
-
value
Value mapped using aMapperManager.- Type Parameters:
T- type of the value- Parameters:
type- class of the value- Returns:
- typed value
-
values
All values concatenated using a comma.- Returns:
- all values joined by a comma
-
allValues
All values of this header.- Returns:
- all configured values
-
allValues
All values of this header. If this header is defined as a single header with comma separated values, setsplitto true.- Parameters:
split- whether to split single value by comma, does nothing if the value is already a list.- Returns:
- list of values
-
valueCount
int valueCount()Number of values this header has.- Returns:
- number of values (minimal number is 1)
-
sensitive
boolean sensitive()Sensitive headers should not be logged, or indexed (HTTP/2).- Returns:
- whether this header is sensitive
-
changing
boolean changing()Changing headers should not be cached, and their value should not be indexed (HTTP/2).- Returns:
- whether this header's value is changing often
-
valueBytes
default byte[] valueBytes()Cached bytes of a single valued header's value.- Returns:
- value bytes
-
writeHttp1Header
Write the current header as an HTTP header to the provided buffer.- Parameters:
buffer- buffer to write to (should be growing)
-