java.lang.Object
io.helidon.common.http.ReadOnlyParameters
io.helidon.common.http.ReadOnlyHeaders
- Direct Known Subclasses:
ReadableBodyPartHeaders
An immutable implementation of
Headers
.
Factories for multi-maps passed to superclass constructors use TreeSet
instead of a concurrency-tolerant
implementation because this is a read-only implementation.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
ReadOnlyHeaders
(Parameters parameters) Returns an immutable deep copy of the providedParameters
instance.protected
ReadOnlyHeaders
(Map<String, List<String>> data) Returns an immutable deep copy of the provided multimap. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReadOnlyHeaders
Creates a new instance populated with the specifiedHeaders
settings.static ReadOnlyHeaders
create
(Parameters initialContent) Deprecated, for removal: This API element is subject to removal in a future version.protected static ReadOnlyHeaders
Creates a newReadOnlyHeaders
instance with the specified multi-map contents as initial contents.static ReadOnlyHeaders
empty()
Returns an empty and immutable singleton.emptyMap()
Creates an emptyMap
suitable (once populated) for read-only access.Creates an emptyMap
suitable (once populated) for read-only access, pre-sized as specified.Methods inherited from class io.helidon.common.http.ReadOnlyParameters
add, add, addAll, all, computeIfAbsent, computeSingleIfAbsent, first, iterator, put, put, putAll, putIfAbsent, putIfAbsent, remove, toMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.helidon.common.http.Parameters
add, add, addAll, computeIfAbsent, computeSingleIfAbsent, first, iterator, put, put, putAll, putIfAbsent, putIfAbsent, remove, toMap
-
Constructor Details
-
ReadOnlyHeaders
Returns an immutable deep copy of the provided multimap.- Parameters:
data
- multi-map data to copy.
-
ReadOnlyHeaders
Returns an immutable deep copy of the providedParameters
instance.- Parameters:
parameters
- parameters to copy.
-
-
Method Details
-
empty
Returns an empty and immutable singleton.- Returns:
- the headers singleton (empty and immutable)
-
create
Creates a newReadOnlyHeaders
instance with the specified multi-map contents as initial contents.- Parameters:
initialContent
- multi-map contains name/values-list pairs for the initial content- Returns:
- new instance with the specified initial content
-
create
@Deprecated(since="3.0.3", forRemoval=true) public static ReadOnlyHeaders create(Parameters initialContent) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance populated with the specifiedParameters
settings.- Parameters:
initialContent
-Parameters
to be used as the initial content for the new instance- Returns:
- new instance with specified initial content
-
create
Creates a new instance populated with the specifiedHeaders
settings.- Parameters:
initialContent
-Headers
to be used as the initial content for the new instance- Returns:
- new instance with specified initial content
-
emptyMap
Description copied from class:ReadOnlyParameters
Creates an emptyMap
suitable (once populated) for read-only access.- Overrides:
emptyMap
in classReadOnlyParameters
- Returns:
- empty
Map
-
emptyMapForCopy
Description copied from class:ReadOnlyParameters
Creates an emptyMap
suitable (once populated) for read-only access, pre-sized as specified.- Overrides:
emptyMapForCopy
in classReadOnlyParameters
- Returns:
- empty
Map
, possibly pre-sized as indicated
-
create(Headers)
instead, passingHeaders
instead ofParameters
.