Interface ReadOnlyStrictMap<K,V>
- All Superinterfaces:
com.google.gwt.user.client.rpc.IsSerializable
,Serializable
- All Known Subinterfaces:
StrictMap<K,
V>
- All Known Implementing Classes:
ImmutableStrictMap
,StrictMapImpl
public interface ReadOnlyStrictMap<K,V>
extends com.google.gwt.user.client.rpc.IsSerializable, Serializable
"Strict" means that it does not allow null keys, and that all methods use generics unlike for example
Map.containsKey(Object)
- Since:
- 3.9.0
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns the adapter toMap
interface for use with 3rd party code or standard Java libraries.boolean
containsKey
(K key) boolean
containsValue
(V value) entrySet()
findKeyForValueIfSame
(V value) Finds first key for the given value found by iterating over theentrySet()
, the value must be the same instance as the one contained in the map, so the equals() is NOT called by this method on the values.boolean
isEmpty()
keySet()
void
int
size()
Returns the same instance if the original map is already immutable, otherwise returns new instance containing the same mappings.toMap()
Returns new map containing the same mappings, so modifying the returned map does not modify the original map.values()
-
Method Details
-
size
int size() -
isEmpty
boolean isEmpty() -
containsKey
-
containsValue
-
get
-
findKeyForValueIfSame
Finds first key for the given value found by iterating over theentrySet()
, the value must be the same instance as the one contained in the map, so the equals() is NOT called by this method on the values. -
putAllTo
-
asMap
Returns the adapter toMap
interface for use with 3rd party code or standard Java libraries. Unlike thetoMap()
which returns new map containing the same elements, this method returns live "view" of this map instance meaning that changes done to the returned instance are reflected also in the original map. Unless the original map is immutable, in which case all methods modifying the content throwUnsupportedOperationException
The returned map isSerializable
-
toMap
Returns new map containing the same mappings, so modifying the returned map does not modify the original map. -
toImmutable
Returns the same instance if the original map is already immutable, otherwise returns new instance containing the same mappings. -
keySet
-
values
-
entrySet
-