Package org.forgerock.http.header
Class TrailerHeader
- java.lang.Object
-
- org.forgerock.http.protocol.Header
-
- org.forgerock.http.header.TrailerHeader
-
public class TrailerHeader extends Header
AHeader
representation of theTrailer
HTTP response header. This header will contain a list of header names that the user-agent will have to expect as trailing headers, added after the response's body. This is informative only, and the actually listed trailer headers may not be present in the end, or additional trailing headers could appear compared to the originally listed ones.This class is not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description TrailerHeader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrailerHeader
addTrailers(String... trailerNames)
Add some new trailers that are expected to be received.TrailerHeader
addTrailers(List<String> trailerNames)
Add some new trailers that are expected to be received.boolean
equals(Object o)
String
getName()
Returns the name of the header, as it would canonically appear within an HTTP message.List<String>
getValues()
Returns the header as a list of strings.int
hashCode()
-
Methods inherited from class org.forgerock.http.protocol.Header
getFirstValue, toString
-
-
-
-
Field Detail
-
NAME
public static final String NAME
The name of the header in the HTTP message.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
Description copied from class:Header
Returns the name of the header, as it would canonically appear within an HTTP message.
-
getValues
public List<String> getValues()
Description copied from class:Header
Returns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachString
should represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeader
implementations each String in thisList
may contain multiple token-separated values.The
List
returned from this method should not be expected to be mutable. However, some subclasses ofHeader
may choose to implement it as such.
-
addTrailers
public TrailerHeader addTrailers(String... trailerNames)
Add some new trailers that are expected to be received.- Parameters:
trailerNames
- the names of the trailers- Returns:
- the header itself to be able to chain method calls.
-
addTrailers
public TrailerHeader addTrailers(List<String> trailerNames)
Add some new trailers that are expected to be received.- Parameters:
trailerNames
- the names of the trailers- Returns:
- the header itself to be able to chain method calls.
-
-