@GenerateBuilder @GenerateSubclass @Freezable(value=ReadOnlyMap.class) public abstract class FreezableHashMap<K,V> extends HashMap<K,V> implements FreezableMap<K,V>
HashMap and makes it freezable.
It is recommended to use only Immutable types for the keys
and ReadOnly or Immutable types for the values.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier | Constructor and Description |
|---|---|
protected |
FreezableHashMap(@NonNegative int initialCapacity,
@Positive float loadFactor) |
protected |
FreezableHashMap(@Nonnull Map<? extends K,? extends V> map) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
@Nonnull @NonFrozen FreezableHashMap<K,V> |
clone() |
@Nonnull net.digitalid.utility.immutable.entry.ReadOnlyEntrySet<K,V> |
entrySet() |
@Nonnull @Frozen ReadOnlyMap<K,V> |
freeze() |
boolean |
isFrozen() |
@Nonnull FreezableSet<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(@Nonnull Map<? extends K,? extends V> map) |
V |
remove(@Nullable Object object) |
@Nonnull String |
toString() |
@Nonnull FreezableCollection<V> |
values() |
static <K,V> @NonFrozen FreezableHashMap<K,V> |
withMappingsOf(FreezableMap<? extends K,? extends V> map)
Returns a new freezable hash map with the mappings of the given map or null if the given map is null.
|
static <K,V> @NonFrozen FreezableHashMap<K,V> |
withMappingsOf(Map<? extends K,? extends V> map)
Returns a new freezable hash map with the mappings of the given map or null if the given map is null.
|
static <K,V> @NonFrozen FreezableHashMap<K,V> |
withMappingsOf(ReadOnlyMap<? extends K,? extends V> map)
Returns a new freezable hash map with the mappings of the given map or null if the given map is null.
|
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, get, getOrDefault, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll, sizeequals, hashCodefinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisEmpty, putAll, putIfAbsentOrNullElseReturnPresent, removeAll, removeAll, removeAll, removeAllcontainsKey, containsValue, getisEmptyOrSingle, isSingle, sizecompute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size@Recover
protected FreezableHashMap(@NonNegative @Default(value="16")
@NonNegative int initialCapacity,
@Positive @Default(value="0.75f")
@Positive float loadFactor)
@Pure @Capturable @NonFrozen public static <K,V> @NonFrozen FreezableHashMap<K,V> withMappingsOf(ReadOnlyMap<? extends K,? extends V> map)
@Pure @Capturable @NonFrozen public static <K,V> @NonFrozen FreezableHashMap<K,V> withMappingsOf(@NonCaptured @Unmodified Map<? extends K,? extends V> map)
@Pure @Capturable @NonFrozen public static <K,V> @NonFrozen FreezableHashMap<K,V> withMappingsOf(@NonCaptured @Unmodified FreezableMap<? extends K,? extends V> map)
@Pure public boolean isFrozen()
isFrozen in interface net.digitalid.utility.freezable.ReadOnlyInterface@Impure @NonFrozenRecipient @Chainable @Nonnull @Frozen public @Nonnull @Frozen ReadOnlyMap<K,V> freeze()
freeze in interface FreezableMap<K,V>freeze in interface net.digitalid.utility.freezable.FreezableInterface@Pure @Capturable @Nonnull @NonFrozen public @Nonnull @NonFrozen FreezableHashMap<K,V> clone()
@Pure @NonCapturable @Nonnull public @Nonnull FreezableSet<K> keySet()
@Pure @NonCapturable @Nonnull public @Nonnull FreezableCollection<V> values()
@Pure @NonCapturable @Nonnull public @Nonnull net.digitalid.utility.immutable.entry.ReadOnlyEntrySet<K,V> entrySet()
@Impure @NonFrozenRecipient @Capturable @Nullable public V put(@Captured K key, @Captured V value)
@Impure @NonFrozenRecipient public void putAll(@NonCaptured @Unmodified @Nonnull @Nonnull Map<? extends K,? extends V> map)
@Impure @NonFrozenRecipient @Capturable @Nullable public V remove(@NonCaptured @Unmodified @Nullable @Nullable Object object)
@Impure @NonFrozenRecipient public void clear()
Copyright © 2017. All rights reserved.