Represents the HTTP trailers of a server response in a server exchange as defined by RFC 7230 Section 4.3.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdds the specified trailers.add(CharSequence name, CharSequence value) Adds a trailer with the specified name and value.booleancontains(CharSequence name) Determines whether a trailer with the specified name is present.booleancontains(CharSequence name, CharSequence value) Determines whether a trailer with the specified name and value is present.get(CharSequence name) Returns the value of the trailer with the specified name.getAll()Returns all trailers in the response.getAll(CharSequence name) Returns the values of all trailers with the specified name.Decodes and returns all trailers in the response.getAllHeader(CharSequence name) Decodes and returns all trailers with the specified name.Returns all trailers in the response as parameters.getAllParameter(CharSequence name) Returns all trailers with the specified name as parameters.getHeader(CharSequence name) Decodes and returns the trailer with the specified name.getNames()Returns the names of the trailers in the response.getParameter(CharSequence name) Returns the trailer with the specified name as a parameter.remove(CharSequence... names) Removes the trailers with the specified names.Sets the specified trailers.set(CharSequence name, CharSequence value) Sets the value of the trailer with the specified name.
-
Method Details
-
add
Adds a trailer with the specified name and value.
- Parameters:
name- the trailer namevalue- the trailer value- Returns:
- the response trailers
-
add
Adds the specified trailers.
- Parameters:
trailers- the trailers to add- Returns:
- the response trailers
-
set
Sets the value of the trailer with the specified name.
- Parameters:
name- the trailer namevalue- the trailer value- Returns:
- the response trailers
-
set
Sets the specified trailers.
- Parameters:
trailers- the trailers to set- Returns:
- the response trailers
-
remove
Removes the trailers with the specified names.
- Parameters:
names- the names of the trailers to remove- Returns:
- the response trailers
-
contains
Determines whether a trailer with the specified name is present.
- Parameters:
name- a trailer name- Returns:
- true if a trailer is present, false otherwise
-
contains
Determines whether a trailer with the specified name and value is present.
- Parameters:
name- a trailer namevalue- a trailer value- Returns:
- true if a trailer is present, false otherwise
-
getNames
Returns the names of the trailers in the response.
- Returns:
- a list of trailer names
-
get
Returns the value of the trailer with the specified name.
If there are multiple trailers with the same name, this method returns the first one.
- Parameters:
name- a trailer name- Returns:
- an optional returning the value of the trailer or an empty optional if there's no trailer with the specified name
-
getAll
Returns the values of all trailers with the specified name.
- Parameters:
name- a trailer name- Returns:
- a list of trailer values or an empty list if there's no trailer with the specified name
-
getAll
Returns all trailers in the response.
- Returns:
- a list of trailer entries or an empty list if there's no trailer
-
getHeader
Decodes and returns the trailer with the specified name.
If there are multiple trailers with the same name, this method returns the first one.
- Type Parameters:
T- the decoded trailer type- Parameters:
name- a trailer name- Returns:
- an optional returning the decoded trailer or an empty optional if there's no trailer with the specified name
-
getAllHeader
Decodes and returns all trailers with the specified name.
- Type Parameters:
T- the decoded trailer type- Parameters:
name- a trailer name- Returns:
- a list of trailer values or an empty list if there's no trailer with the specified name
-
getAllHeader
Decodes and returns all trailers in the response.
- Returns:
- a list of trailers or an empty list if there's no trailer
-
getParameter
Returns the trailer with the specified name as a parameter.
If there are multiple trailers with the same name, this method returns the first one.
- Parameters:
name- a trailer name- Returns:
- an optional returning the parameter or an empty optional if there's no trailer with the specified name
-
getAllParameter
Returns all trailers with the specified name as parameters.
- Parameters:
name- a trailer name- Returns:
- a list of parameters or an empty list if there's no trailer with the specified name
-
getAllParameter
Returns all trailers in the response as parameters.
- Returns:
- a list of parameters or an empty list if there's no trailer
-