Class NonNullProxy<K2,V2>

java.lang.Object
eu.bandm.tools.util.nonnull.MapProxy<K2,V2>
eu.bandm.tools.util.nonnull.NonNullProxy<K2,V2>
Type Parameters:
K2 - the type of the keys
V2 - the type of the values
All Implemented Interfaces:
Nullfree, NonNullKeyMap<K2,V2>, NonNullMap<K2,V2>, NonNullValueMap<K2,V2>, Serializable, Map<K2,V2>

class NonNullProxy<K2,V2> extends MapProxy<K2,V2> implements NonNullMap<K2,V2>
Internal proxy which inserts the checks for non-null into all state-changing methods. Not directly accessible by the user.
  • Constructor Details

    • NonNullProxy

      NonNullProxy(Map<K2,V2> peer)
      Not directly accessible by the user.
      Parameters:
      peer - The object from JDK runtime which makes the real work.
  • Method Details

    • put

      public V2 put(K2 k, V2 v)
      Specified by:
      put in interface Map<K2,V2>
    • putAll

      public void putAll(Map<? extends K2,? extends V2> t)
      Specified by:
      putAll in interface Map<K2,V2>
    • entrySet

      public Set<Map.Entry<K2,V2>> entrySet()
      Needs special implementation of entrySet, Iterator and Map.Entry for prohibiting "setValue(null)"!
      Specified by:
      entrySet in interface Map<K2,V2>
      Overrides:
      entrySet in class MapProxy<K2,V2>