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 Type
    Method
    Description
    Returns the adapter to Map interface for use with 3rd party code or standard Java libraries.
    boolean
     
    boolean
     
     
    Finds first key for the given value found by iterating over the entrySet(), 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.
    get(K key)
     
    boolean
     
     
    void
    putAllTo(Map<? super K,? super V> m)
     
    int
     
    Returns the same instance if the original map is already immutable, otherwise returns new instance containing the same mappings.
    Returns new map containing the same mappings, so modifying the returned map does not modify the original map.
     
  • Method Details

    • size

      int size()
    • isEmpty

      boolean isEmpty()
    • containsKey

      boolean containsKey(@NotNull K key)
    • containsValue

      boolean containsValue(@Nullable V value)
    • get

      @Nullable V get(@NotNull K key)
    • findKeyForValueIfSame

      @Nullable K findKeyForValueIfSame(@NotNull V value)
      Finds first key for the given value found by iterating over the entrySet(), 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

      void putAllTo(@NotNull Map<? super K,? super V> m)
    • asMap

      @NotNull Map<K,V> asMap()
      Returns the adapter to Map interface for use with 3rd party code or standard Java libraries. Unlike the toMap() 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 throw UnsupportedOperationException The returned map is Serializable
    • toMap

      @NotNull Map<K,V> toMap()
      Returns new map containing the same mappings, so modifying the returned map does not modify the original map.
    • toImmutable

      @NotNull ImmutableStrictMap<K,V> toImmutable()
      Returns the same instance if the original map is already immutable, otherwise returns new instance containing the same mappings.
    • keySet

      @NotNull Set<K> keySet()
    • values

      @NotNull Collection<V> values()
    • entrySet

      @NotNull Set<Map.Entry<K,V>> entrySet()