public final class ValueMapUtil
extends java.lang.Object
ValueMaps.| Modifier and Type | Method and Description |
|---|---|
static @NotNull ValueMap |
cache(@NotNull ValueMap valueMap)
Decorates the given
ValueMap with a caching layer. |
static @NotNull ValueMap |
merge(@NotNull java.util.List<ValueMap> valueMaps)
Merge provided
ValueMaps into a single view ValueMap that aggregates
all key-value pairs of the given maps. |
static @NotNull ValueMap |
merge(ValueMap... valueMaps)
A convenience method that turns the var-args into a
Collection
and delegates to merge(List). |
static @NotNull ValueMap |
mergeAndCache(@NotNull java.util.List<ValueMap> valueMaps)
Convenience method that allows creating a merged
ValueMap where
accessed mappings are cached to optimize repeated lookups. |
@NotNull public static @NotNull ValueMap merge(@NotNull ValueMap... valueMaps)
Collection
and delegates to merge(List).valueMaps - the ValueMap instances to mergeValueMap viewmerge(List)@NotNull public static @NotNull ValueMap merge(@NotNull @NotNull java.util.List<ValueMap> valueMaps)
ValueMaps into a single view ValueMap that aggregates
all key-value pairs of the given maps. The value for a key-value pair is taken from
the first ValueMap (in iteration order) that has a mapping for the given key.
merge(vm1, vm2, vm3 where all maps vm1, vm2, vm3 have
a value mapped to the key k1, then the value from vm1 is returned.valueMaps - the ValueMap instances to mergeValueMap view@NotNull public static @NotNull ValueMap mergeAndCache(@NotNull @NotNull java.util.List<ValueMap> valueMaps)
ValueMap where
accessed mappings are cached to optimize repeated lookups.
cache(merge(valueMaps)).valueMaps - the ValueMap instances to mergeValueMap view@NotNull public static @NotNull ValueMap cache(@NotNull @NotNull ValueMap valueMap)
ValueMap with a caching layer.
Every key-value pair that is accessed is cached for
subsequent accesses. Calls to ValueMap#keySet(),
ValueMap#values() and ValueMap#entrySet()
will cause all entries to be cached.
ValueMap is modified, the
modification may not be reflected via the caching wrapper.valueMap - the ValueMap instance to cacheValueMap viewCopyright © 2022 The Apache Software Foundation. All rights reserved.