Interface ServerResponseTrailers
- All Superinterfaces:
Headers, Iterable<Header>, WritableHeaders<ServerResponseTrailers>
Mutable trailers of a server response.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ServerResponseTrailerscreate()Create a new instance of mutable server response trailers.static ServerResponseTrailersCreate a new instance of mutable server response trailers.static ServerResponseTrailerswrap(WritableHeaders<?> existing) Create a new instance of mutable server response trailers by wrapping existing writable trailers.Methods inherited from interface Headers
acceptedTypes, all, contains, contains, containsToken, contentLength, contentType, find, first, get, isAccepted, size, stream, toMap, value, valuesModifier and TypeMethodDescriptionReturns a list of acceptedTypes (HeaderNames.ACCEPTheader) content discoveryTypes in quality factor order.all(HeaderName name, Supplier<List<String>> defaultSupplier) Get all values of a header.booleanWhether these headers contain a header with the provided name and value.booleancontains(HeaderName name) Whether these headers contain a header with the provided name.default booleancontainsToken(Header value) Whether these headers contain all tokenized values from the provided header.default OptionalLongContent length if defined.default Optional<HttpMediaType> Content type (if defined).find(HeaderName headerName) Find the first header.first(HeaderName headerName) Returns a first header value.get(HeaderName name) Get a header value.default booleanisAccepted(MediaType... mediaTypes) Whether this media type is accepted by these headers.intsize()Number of headers in these headers.stream()A sequential stream with these headers as the source.toMap()Deprecated.use other methods to handle headers, preferably using pull approachvalue(HeaderName headerName) Returns a header value as a singleStringpotentially concatenated using comma character fromHeaders.all(HeaderName, java.util.function.Supplier)header fields.values(HeaderName headerName) Returns an unmodifiableListof all comma separated header value parts - Such segmentation is NOT valid for all header semantics, however it is very common.Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface WritableHeaders
add, add, add, add, clear, contentLength, contentType, from, remove, remove, set, set, set, set, set, setIfAbsentModifier and TypeMethodDescriptionAdd a header or add a header value if the header is already present.default ServerResponseTrailersadd(HeaderName header, int value) Add a header or add a header value if the header is already present.default ServerResponseTrailersadd(HeaderName header, long value) Add a header or add a header value if the header is already present.default ServerResponseTrailersadd(HeaderName header, String... value) Add a header or add a header value if the header is already present.clear()Clear all current headers.default ServerResponseTrailerscontentLength(long length) Content length of the entity in bytes.default ServerResponseTrailerscontentType(MediaType contentType) Sets the MIME type of the response body.For each header from the provided headers, set its value on these headers.remove(HeaderName name) Remove a header.remove(HeaderName name, Consumer<Header> removedConsumer) Remove a header.Set a header and replace it if it already existed.default ServerResponseTrailersset(HeaderName name, int value) Set a header and replace it if it already existed.default ServerResponseTrailersset(HeaderName name, long value) Set a header and replace it if it already existed.default ServerResponseTrailersset(HeaderName name, String... values) Set a header and replace it if it already existed.default ServerResponseTrailersset(HeaderName name, Collection<String> values) Set a header and replace it if it already existed.setIfAbsent(Header header) Set a value of a header unless it is already present.
-
Method Details
-
create
Create a new instance of mutable server response trailers.- Returns:
- new server response trailers
-
create
Create a new instance of mutable server response trailers.- Parameters:
existing- trailers to add to these response trailers- Returns:
- new server response trailers
-
wrap
Create a new instance of mutable server response trailers by wrapping existing writable trailers. Any updates to this class will also impact the underlying trailers.- Parameters:
existing- trailers to wrap- Returns:
- new server response trailers
-