Class WriteableBodyPartHeaders
java.lang.Object
io.helidon.reactive.media.multipart.WriteableBodyPartHeaders
- All Implemented Interfaces:
Headers,WritableHeaders<WriteableBodyPartHeaders>,BodyPartHeaders,Iterable<Http.HeaderValue>
public final class WriteableBodyPartHeaders
extends Object
implements BodyPartHeaders, WritableHeaders<WriteableBodyPartHeaders>
Writeable body part headers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class to createWriteableBodyPartHeadersinstances. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of acceptedTypes (Http.Header.ACCEPTheader) content discoveryTypes in quality factor order.add(Http.HeaderValue header) Add a header or add a header value if the header is already present.all(Http.HeaderName name, Supplier<List<String>> defaultSupplier) Get all values of a header.builder()Create a new builder instance.clear()Clear all current headers.booleancontains(Http.HeaderName name) Whether these headers contain a header with the provided name.booleancontains(Http.HeaderValue value) Whether these headers contain a header with the provided name and value.Get theContent-Dispositionheader.voidcontentDisposition(ContentDisposition contentDisposition) Sets the value ofHttp.Header.CONTENT_DISPOSITIONheader.static WriteableBodyPartHeaderscreate()Create a new instance ofWriteableBodyPartHeaderswith empty headers.get(Http.HeaderName name) Get a header value.iterator()Get theContent-Typeheader.remove(Http.HeaderName name) Remove a header.remove(Http.HeaderName name, Consumer<Http.HeaderValue> removedConsumer) Remove a header.set(Http.HeaderValue header) Set a header and replace it if it already existed.setIfAbsent(Http.HeaderValue header) Set a value of a header unless it is already present.intsize()Number of headers in these headers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.reactive.media.multipart.BodyPartHeaders
defaultContentTypeMethods inherited from interface io.helidon.common.http.Headers
all, contentLength, contentType, first, isAccepted, toMap, value, valuesMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface io.helidon.common.http.WritableHeaders
add, contentLength, contentType, contentType, set, set
-
Method Details
-
builder
Create a new builder instance.- Returns:
- Builder
-
create
Create a new instance ofWriteableBodyPartHeaderswith empty headers.- Returns:
- WriteableBodyPartHeaders
-
all
Description copied from interface:HeadersGet all values of a header. -
contains
Description copied from interface:HeadersWhether these headers contain a header with the provided name. -
contains
Description copied from interface:HeadersWhether these headers contain a header with the provided name and value. -
get
Description copied from interface:HeadersGet a header value. -
size
public int size()Description copied from interface:HeadersNumber of headers in these headers. -
acceptedTypes
Description copied from interface:HeadersReturns a list of acceptedTypes (Http.Header.ACCEPTheader) content discoveryTypes in quality factor order. Nevernull. Returns an empty list by default.- Specified by:
acceptedTypesin interfaceHeaders- Returns:
- A list of acceptedTypes media discoveryTypes.
-
setIfAbsent
Description copied from interface:WritableHeadersSet a value of a header unless it is already present.- Specified by:
setIfAbsentin interfaceWritableHeaders<WriteableBodyPartHeaders>- Parameters:
header- header with value to set- Returns:
- this instance
-
add
Description copied from interface:WritableHeadersAdd a header or add a header value if the header is already present.- Specified by:
addin interfaceWritableHeaders<WriteableBodyPartHeaders>- Parameters:
header- header with value- Returns:
- this instance
-
remove
Description copied from interface:WritableHeadersRemove a header.- Specified by:
removein interfaceWritableHeaders<WriteableBodyPartHeaders>- Parameters:
name- name of the header to remove- Returns:
- this instance
-
remove
public WriteableBodyPartHeaders remove(Http.HeaderName name, Consumer<Http.HeaderValue> removedConsumer) Description copied from interface:WritableHeadersRemove a header.- Specified by:
removein interfaceWritableHeaders<WriteableBodyPartHeaders>- Parameters:
name- name of the header to removeremovedConsumer- consumer to be called with existing header; if the header did not exist, consumer will not be called- Returns:
- this instance
-
set
Description copied from interface:WritableHeadersSet a header and replace it if it already existed.- Specified by:
setin interfaceWritableHeaders<WriteableBodyPartHeaders>- Parameters:
header- header to set- Returns:
- this instance
-
clear
Description copied from interface:WritableHeadersClear all current headers.- Specified by:
clearin interfaceWritableHeaders<WriteableBodyPartHeaders>- Returns:
- this instance
-
iterator
- Specified by:
iteratorin interfaceIterable<Http.HeaderValue>
-
partContentType
Description copied from interface:BodyPartHeadersGet theContent-Typeheader. If theContent-Typeheader is not present, the default value is retrieved usingBodyPartHeaders.defaultContentType().- Specified by:
partContentTypein interfaceBodyPartHeaders- Returns:
- HttpMediaType, never
null
-
contentDisposition
Description copied from interface:BodyPartHeadersGet theContent-Dispositionheader.- Specified by:
contentDispositionin interfaceBodyPartHeaders- Returns:
- ContentDisposition, never
null
-
contentDisposition
Sets the value ofHttp.Header.CONTENT_DISPOSITIONheader.- Parameters:
contentDisposition- content disposition
-