- java.lang.Object
- 
- io.helidon.common.http.HashParameters
 
- 
- All Implemented Interfaces:
- Parameters
 - Direct Known Subclasses:
- WriteableBodyPartHeaders
 
 public class HashParameters extends Object implements Parameters AConcurrentSkipListMapbasedParametersimplementation with case-insensitive keys and immutableListof values that needs to be copied on each write.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedHashParameters()Creates a new instance.protectedHashParameters(Parameters initialContent)Creates a new instance from provided data.protectedHashParameters(Map<String,List<String>> initialContent)Creates a new instance from provided data.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HashParametersadd(String key, Iterable<String> values)Adds specified values tu association with the specified key (optional operation).HashParametersadd(String key, String... values)Adds specified values tu association with the specified key (optional operation).HashParametersaddAll(Parameters parameters)Copies all of the mappings from the specifiedparametersto this instance adding values to existing associations (optional operation).List<String>all(String name)Returns an unmodifiable List of all of the values of the given named parameter.List<String>computeIfAbsent(String key, Function<String,Iterable<String>> values)If the specified key is not already associated with a value computes new association using the given function and returns emptyList, else returns the current value (optional operation).List<String>computeSingleIfAbsent(String key, Function<String,String> value)If the specified key is not already associated with a value computes new association using the given function and returns emptyList, else returns the current value (optional operation).static HashParametersconcat(Parameters... parameters)Creates new instance ofHashParametersas a concatenation of provided parameters.static HashParametersconcat(Iterable<Parameters> parameters)Creates new instance ofHashParametersas a concatenation of provided parameters.static HashParameterscreate()Creates a new empty instanceHashParameters.static HashParameterscreate(Parameters initialContent)Creates a new instanceHashParametersfrom provided data.static HashParameterscreate(Map<String,List<String>> initialContent)Creates a new instanceHashParametersfrom provided data.booleanequals(Object o)Optional<String>first(String name)Returns anOptionalcontaining the first value of the given parameter (and possibly multi-valued) parameter.inthashCode()List<String>put(String key, Iterable<String> values)Associates specified values with the specified key (optional operation).List<String>put(String key, String... values)Associates specified values with the specified key (optional operation).HashParametersputAll(Parameters parameters)Copies all of the mappings from the specifiedparametersto this instance replacing values of existing associations (optional operation).List<String>putIfAbsent(String key, Iterable<String> values)If the specified key is not already associated with a value associates it with the given value and returns emptyList, else returns the current value (optional operation).List<String>putIfAbsent(String key, String... values)If the specified key is not already associated with a value associates it with the given value and returns emptyList, else returns the current value (optional operation).List<String>remove(String key)Removes the mapping for a key if it is present (optional operation).Map<String,List<String>>toMap()Returns a copy of parameters as a Map.StringtoString()
 
- 
- 
- 
Constructor Detail- 
HashParametersprotected HashParameters() Creates a new instance.
 - 
HashParametersprotected HashParameters(Map<String,List<String>> initialContent) Creates a new instance from provided data. Initial data are copied.- Parameters:
- initialContent- initial content.
 
 - 
HashParametersprotected HashParameters(Parameters initialContent) Creates a new instance from provided data. Initial data is copied.- Parameters:
- initialContent- initial content.
 
 
- 
 - 
Method Detail- 
createpublic static HashParameters create() Creates a new empty instanceHashParameters.- Returns:
- a new instance of HashParameters.
 
 - 
createpublic static HashParameters create(Map<String,List<String>> initialContent) Creates a new instanceHashParametersfrom provided data. Initial data is copied.- Parameters:
- initialContent- initial content.
- Returns:
- a new instance of HashParametersinitialized with the given content.
 
 - 
createpublic static HashParameters create(Parameters initialContent) Creates a new instanceHashParametersfrom provided data. Initial data is copied.- Parameters:
- initialContent- initial content.
- Returns:
- a new instance of HashParametersinitialized with the given content.
 
 - 
concatpublic static HashParameters concat(Parameters... parameters) Creates new instance ofHashParametersas a concatenation of provided parameters. Values for keys found across the provided parameters are "concatenated" into aListentry for their respective key in the createdHashParametersinstance.- Parameters:
- parameters- parameters to concatenate.
- Returns:
- a new instance of HashParametersthat represents the concatenation of the provided parameters.
 
 - 
concatpublic static HashParameters concat(Iterable<Parameters> parameters) Creates new instance ofHashParametersas a concatenation of provided parameters. Values for keys found across the provided parameters are "concatenated" into aListentry for their respective key in the createdHashParametersinstance.- Parameters:
- parameters- parameters to concatenate.
- Returns:
- a new instance of HashParametersthat represents the concatenation of the provided parameters.
 
 - 
firstpublic Optional<String> first(String name) Description copied from interface:ParametersReturns anOptionalcontaining the first value of the given parameter (and possibly multi-valued) parameter. If the parameter is not present, then the returned Optional is empty.- Specified by:
- firstin interface- Parameters
- Parameters:
- name- the parameter name
- Returns:
- an Optional<V>for the first named value
 
 - 
allpublic List<String> all(String name) Description copied from interface:ParametersReturns an unmodifiable List of all of the values of the given named parameter. Always returns a List, which may be empty if the parameter is not present.- Specified by:
- allin interface- Parameters
- Parameters:
- name- the parameter name
- Returns:
- a Listof values with zero or greater size
 
 - 
putpublic List<String> put(String key, String... values) Description copied from interface:ParametersAssociates specified values with the specified key (optional operation). If parameters previously contained a mapping for the key, the old values fully replaced.- Specified by:
- putin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be associated with the specified key
- Returns:
- the previous values associated with key, or empty Listif there was no mapping for key.
 
 - 
putpublic List<String> put(String key, Iterable<String> values) Description copied from interface:ParametersAssociates specified values with the specified key (optional operation). If parameters previously contained a mapping for the key, the old values fully replaced.- Specified by:
- putin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be associated with the specified key. If- nullthen association will be removed.
- Returns:
- the previous values associated with key, or empty Listif there was no mapping for key.
 
 - 
putIfAbsentpublic List<String> putIfAbsent(String key, String... values) Description copied from interface:ParametersIf the specified key is not already associated with a value associates it with the given value and returns emptyList, else returns the current value (optional operation).- Specified by:
- putIfAbsentin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be associated with the specified key
- Returns:
- the previous values associated with key, or empty Listif there was no mapping for key.
 
 - 
putIfAbsentpublic List<String> putIfAbsent(String key, Iterable<String> values) Description copied from interface:ParametersIf the specified key is not already associated with a value associates it with the given value and returns emptyList, else returns the current value (optional operation).- Specified by:
- putIfAbsentin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be associated with the specified key
- Returns:
- the previous values associated with key, or empty Listif there was no mapping for key.
 
 - 
computeIfAbsentpublic List<String> computeIfAbsent(String key, Function<String,Iterable<String>> values) Description copied from interface:ParametersIf the specified key is not already associated with a value computes new association using the given function and returns emptyList, else returns the current value (optional operation).- Specified by:
- computeIfAbsentin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be associated with the specified key
- Returns:
- the current (potentially computed) values associated with key,
 or empty Listif function returnsnull
 
 - 
computeSingleIfAbsentpublic List<String> computeSingleIfAbsent(String key, Function<String,String> value) Description copied from interface:ParametersIf the specified key is not already associated with a value computes new association using the given function and returns emptyList, else returns the current value (optional operation).- Specified by:
- computeSingleIfAbsentin interface- Parameters
- Parameters:
- key- a key with which the specified value is to be associated
- value- a single value to be associated with the specified key
- Returns:
- the current (potentially computed) values associated with key,
 or empty Listif function returnsnull
 
 - 
putAllpublic HashParameters putAll(Parameters parameters) Description copied from interface:ParametersCopies all of the mappings from the specifiedparametersto this instance replacing values of existing associations (optional operation).- Specified by:
- putAllin interface- Parameters
- Parameters:
- parameters- to copy.
- Returns:
- this instance of Parameters
 
 - 
addpublic HashParameters add(String key, String... values) Description copied from interface:ParametersAdds specified values tu association with the specified key (optional operation). If parameters doesn't contains mapping, new mapping is created.- Specified by:
- addin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be add to association with the specified key
- Returns:
- this instance of Parameters
 
 - 
addpublic HashParameters add(String key, Iterable<String> values) Description copied from interface:ParametersAdds specified values tu association with the specified key (optional operation). If parameters doesn't contains mapping, new mapping is created.- Specified by:
- addin interface- Parameters
- Parameters:
- key- key with which the specified value is to be associated
- values- value to be add to association with the specified key. If- nullthen noting will be add.
- Returns:
- this instance of Parameters
 
 - 
addAllpublic HashParameters addAll(Parameters parameters) Description copied from interface:ParametersCopies all of the mappings from the specifiedparametersto this instance adding values to existing associations (optional operation).- Specified by:
- addAllin interface- Parameters
- Parameters:
- parameters- to copy.
- Returns:
- this instance of Parameters
 
 - 
removepublic List<String> remove(String key) Description copied from interface:ParametersRemoves the mapping for a key if it is present (optional operation).- Specified by:
- removein interface- Parameters
- Parameters:
- key- key whose mapping is to be removed.
- Returns:
- the previous value associated with key, or empty List.
 
 - 
toMappublic Map<String,List<String>> toMap() Description copied from interface:ParametersReturns a copy of parameters as a Map. This interface should only be used when it is required to iterate over the entire set of parameters.- Specified by:
- toMapin interface- Parameters
- Returns:
- the Map
 
 
- 
 
-