Class ChangeAwareMaps
java.lang.Object
io.github.mmm.value.observable.container.map.ChangeAwareMaps
Factory for
ChangeAwareMap.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> ChangeAwareMap <K, V> empty()static <K,V> ChangeAwareMap <K, V> of()static <K,V> ChangeAwareMap <K, V> of(int capacity) static <K,V> ChangeAwareMap <K, V> static <K,V> ChangeAwareMap <K, V> ofUnmodifiable(Supplier<Map<K, V>> mapSupplier) static <K,V> ChangeAwareMap <K, V> ofUnmodifiable(Map<K, V> map)
-
Method Details
-
empty
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Returns:
- an empty, immutable
ChangeAwareMap.
-
of
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Returns:
- a new empty mutable
ChangeAwareMap.
-
of
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Parameters:
capacity- the initial capacity of the map.- Returns:
- a new empty mutable
ChangeAwareMap.
-
of
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Parameters:
map- the existingSetimplementation to wrap asChangeAwareMap. Please avoid to modify thisMapafterwards, as this will not trigger modification events.- Returns:
- a new empty mutable
ChangeAwareMap.
-
ofUnmodifiable
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Parameters:
map- the existingMapimplementation to wrap asChangeAwareMap. Modifying suchMapafterwards will not trigger modification events in the read-only view returned by this method.- Returns:
- a unmodifiable
ChangeAwareMapthat acts as a view on the givenMap.
-
ofUnmodifiable
- Type Parameters:
K- type of thekeys.V- type of thevalues.- Parameters:
mapSupplier- theSupplierto the (mutable)Mapimplementation to wrap asChangeAwareMap. Modifying suchMapafterwards will not trigger modification events in the read-only view returned by this method.- Returns:
- a unmodifiable
ChangeAwareMapthat acts as a view on thesuppliedMap.
-