Package com.aspectran.utils
Class LinkedCaseInsensitiveMultiValueMap<V>
java.lang.Object
com.aspectran.utils.LinkedCaseInsensitiveMultiValueMap<V>
- Type Parameters:
V
- the value type
- All Implemented Interfaces:
MultiValueMap<String,
,V> Serializable
,Map<String,
List<V>>
public class LinkedCaseInsensitiveMultiValueMap<V>
extends Object
implements MultiValueMap<String,V>, Serializable
This class is a clone of org.springframework.util.LinkedCaseInsensitiveMultiValueMap
LinkedHashMap
variant that stores String keys in a case-insensitive
manner, for example for key-based access in a results table.
Preserves the original order as well as the original casing of keys, while allowing for contains, get and remove calls with any case of key.
Does not support null
keys.
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, empty instance of theLinkedCaseInsensitiveMultiValueMap
object.LinkedCaseInsensitiveMultiValueMap
(int initialCapacity) Constructs a new, empty instance of theLinkedCaseInsensitiveMultiValueMap
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given single value to the current list of values for the given key.void
addAll
(MultiValueMap<String, V> values) Add all the values of the givenMultiValueMap
to the current values.void
Add all the values of the given list to the current list of values for the given key.void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
void
forEach
(BiConsumer<? super String, ? super List<V>> action) Return the first value for the given key.int
hashCode()
boolean
isEmpty()
keySet()
void
void
Set the given single value under the given key.void
Set the given values under the given key.void
Set the given values under.int
size()
Return aMap
with the first values contained in thisMultiValueMap
.toString()
Collection<List<V>>
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
Methods inherited from interface com.aspectran.utils.MultiValueMap
addIfAbsent
-
Constructor Details
-
LinkedCaseInsensitiveMultiValueMap
public LinkedCaseInsensitiveMultiValueMap()Constructs a new, empty instance of theLinkedCaseInsensitiveMultiValueMap
object. -
LinkedCaseInsensitiveMultiValueMap
public LinkedCaseInsensitiveMultiValueMap(int initialCapacity) Constructs a new, empty instance of theLinkedCaseInsensitiveMultiValueMap
object.- Parameters:
initialCapacity
- the initial capacity
-
-
Method Details
-
getFirst
Description copied from interface:MultiValueMap
Return the first value for the given key.- Specified by:
getFirst
in interfaceMultiValueMap<String,
V> - Parameters:
key
- the key- Returns:
- the first value for the specified key, or
null
if none
-
add
Description copied from interface:MultiValueMap
Add the given single value to the current list of values for the given key.- Specified by:
add
in interfaceMultiValueMap<String,
V> - Parameters:
key
- the keyvalue
- the value to be added
-
addAll
Description copied from interface:MultiValueMap
Add all the values of the given list to the current list of values for the given key.- Specified by:
addAll
in interfaceMultiValueMap<String,
V> - Parameters:
key
- they keyvalues
- the values to be added
-
addAll
Description copied from interface:MultiValueMap
Add all the values of the givenMultiValueMap
to the current values.- Specified by:
addAll
in interfaceMultiValueMap<String,
V> - Parameters:
values
- the values to be added
-
set
Description copied from interface:MultiValueMap
Set the given single value under the given key.- Specified by:
set
in interfaceMultiValueMap<String,
V> - Parameters:
key
- the keyvalue
- the value to set
-
set
Description copied from interface:MultiValueMap
Set the given values under the given key.- Specified by:
set
in interfaceMultiValueMap<String,
V> - Parameters:
key
- the keyvalues
- the values
-
setAll
Description copied from interface:MultiValueMap
Set the given values under.- Specified by:
setAll
in interfaceMultiValueMap<String,
V> - Parameters:
values
- the values
-
toSingleValueMap
Description copied from interface:MultiValueMap
Return aMap
with the first values contained in thisMultiValueMap
.- Specified by:
toSingleValueMap
in interfaceMultiValueMap<String,
V> - Returns:
- a single value representation of this map
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
List<V>>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
List<V>>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
forEach
-
equals
-
hashCode
public int hashCode() -
toString
-