Package net.officefloor.server.http
Interface HttpResponseHeaders
- All Superinterfaces:
Iterable<HttpHeader>
- All Known Implementing Classes:
ProcessAwareHttpResponseHeaders
HttpHeader instances for the HttpResponse.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionAdds aHttpHeaderfor the response.addHeader(String name, HttpHeaderValue value) Adds aHttpHeader.addHeader(HttpHeaderName name, String value) Adds aHttpHeader.addHeader(HttpHeaderName name, HttpHeaderValue value) Adds aHttpHeader.Obtains the firstHttpHeaderby the name.getHeaders(String name) Obtains all theHttpHeaderinstances by the name.booleanremoveHeader(HttpHeader header) Removes the particularHttpHeaderfrom the response.booleanremoveHeaders(String name) Removes allHttpHeaderinstances by the name.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
addHeader
Adds a
HttpHeaderfor the response.HttpHeaderinstances are provided on the response in the order they are added.- Parameters:
name- Name ofHttpHeader.value- Value ofHttpHeader.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
Adds aHttpHeader.- Parameters:
name-HttpHeaderName.value- Value ofHttpHeader.- Returns:
- Added
HttpHeader - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
Adds aHttpHeader.- Parameters:
name- Name ofHttpHeader.value-HttpHeaderValue.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
Adds aHttpHeader.- Parameters:
name-HttpHeaderName.value-HttpHeaderValue.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
removeHeader
Removes the particularHttpHeaderfrom the response.- Parameters:
header-HttpHeaderto be removed from the response.- Returns:
trueif theHttpHeaderwas removed.
-
removeHeaders
Removes all
HttpHeaderinstances by the name.This method compliments
addHeader(String, String)to allow adding a new singleHttpHeaderinstance by name.- Parameters:
name- Name of theHttpHeaderinstances to remove.- Returns:
trueifHttpHeaderinstances were removed by the name.
-
getHeader
Obtains the firstHttpHeaderby the name.- Parameters:
name- Name of theHttpHeader.- Returns:
- First
HttpHeaderornullif notHttpHeader.
-
getHeaders
Obtains all theHttpHeaderinstances by the name.- Parameters:
name- Name of theHttpHeaderinstances.- Returns:
- All
HttpHeaderinstances by the name.
-