public interface HttpMetaData
Modifier and Type | Method and Description |
---|---|
default HttpMetaData |
addCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default HttpMetaData |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default HttpMetaData |
addHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Adds a new header with the specified
name and value . |
default HttpMetaData |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
default HttpMetaData |
addSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default HttpMetaData |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
HttpHeaders |
headers()
Returns the headers of this message.
|
default HttpMetaData |
setHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Sets a header with the specified
name and value . |
default HttpMetaData |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
java.lang.String |
toString()
Returns a string representation of the message.
|
default java.lang.String |
toString(java.util.function.BiFunction<? super java.lang.CharSequence,? super java.lang.CharSequence,java.lang.CharSequence> headerFilter)
Returns a string representation of the message and headers.
|
HttpProtocolVersion |
version()
Returns the protocol version of this
HttpMetaData . |
HttpMetaData |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData . |
HttpProtocolVersion version()
HttpMetaData
.HttpMetaData version(HttpProtocolVersion version)
HttpMetaData
.version
- the protocol version to set.this
.HttpHeaders headers()
default HttpMetaData addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
name
and value
.name
- the name of the header.value
- the value of the header.this
.default HttpMetaData addHeaders(HttpHeaders headers)
headers
object.headers
- the headers to add.this
.default HttpMetaData setHeader(java.lang.CharSequence name, java.lang.CharSequence value)
name
and value
. Any existing headers with the same name are
overwritten.name
- the name of the header.value
- the value of the header.this
.default HttpMetaData setHeaders(HttpHeaders headers)
headers
object.headers
- the headers object which contains new values.this
.default HttpMetaData addCookie(HttpCookiePair cookie)
This may result in multiple HttpCookiePair
s with same name.
cookie
- the cookie to add.this
.default HttpMetaData addCookie(java.lang.CharSequence name, java.lang.CharSequence value)
name
and
value
.
This may result in multiple HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
name
- the name of the cookie.value
- the value of the cookie.this
.default HttpMetaData addSetCookie(HttpSetCookie cookie)
This may result in multiple HttpSetCookie
s with same name.
cookie
- the cookie to add.this
.default HttpMetaData addSetCookie(java.lang.CharSequence name, java.lang.CharSequence value)
name
and value
.
This may result in multiple HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
name
- the name of the cookie.value
- the value of the cookie.this
.java.lang.String toString()
toString
in class java.lang.Object
default java.lang.String toString(java.util.function.BiFunction<? super java.lang.CharSequence,? super java.lang.CharSequence,java.lang.CharSequence> headerFilter)
headerFilter
- a function that accepts the header name and value and returns the filtered value