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
AHeaderrepresentation of theTrailerHTTP 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 TrailerHeaderaddTrailers(String... trailerNames)Add some new trailers that are expected to be received.TrailerHeaderaddTrailers(List<String> trailerNames)Add some new trailers that are expected to be received.booleanequals(Object o)StringgetName()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.inthashCode()-
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:HeaderReturns the name of the header, as it would canonically appear within an HTTP message.
-
getValues
public List<String> getValues()
Description copied from class:HeaderReturns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachStringshould represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeaderimplementations each String in thisListmay contain multiple token-separated values.The
Listreturned from this method should not be expected to be mutable. However, some subclasses ofHeadermay 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.
-
-