Class UnmodifiableMap<K,​V>

  • Type Parameters:
    K - the key type of the map
    V - the value type of the map
    All Implemented Interfaces:
    IStringValueProvider, IVilGenericType, IVilType

    public class UnmodifiableMap<K,​V>
    extends Map<K,​V>
    Represents an unmodifiable map. This is just a runtime type.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • UnmodifiableMap

        public UnmodifiableMap​(java.util.Map<java.lang.Object,​java.lang.Object> map,
                               TypeDescriptor<?>[] types)
        Creates a map wrapper.
        Parameters:
        map - the map to be wrapped
        types - the types in map
    • Method Detail

      • add

        public void add​(java.lang.Object key,
                        V value)
        Adds a key-value pair to this map and overrides existing mappings.
        Overrides:
        add in class Map<K,​V>
        Parameters:
        key - the key for the mapping (null is ignored)
        value - the value of the mapping
      • remove

        public void remove​(java.lang.Object key)
        Removes the given key from the map.
        Overrides:
        remove in class Map<K,​V>
        Parameters:
        key - the key to be removed