Package io.protostuff

Class MapSchema.MapWrapper<K,V>

java.lang.Object
io.protostuff.MapSchema.MapWrapper<K,V>
All Implemented Interfaces:
Map.Entry<K,V>
Enclosing class:
MapSchema<K,V>

public static final class MapSchema.MapWrapper<K,V> extends Object implements Map.Entry<K,V>
A Map.Entry w/c wraps a Map.
  • Field Details

    • map

      final Map<K,V> map
      The actual map being operated on.
    • value

      V value
      A temporary storage for the value if the key is not yet available.
  • Constructor Details

    • MapWrapper

      MapWrapper(Map<K,V> map)
  • Method Details

    • getKey

      public K getKey()
      The key is provided as the last arg of MapSchema.putValueFrom(Input, MapWrapper, Object).
      Specified by:
      getKey in interface Map.Entry<K,V>
    • getValue

      public V getValue()
      Gets the last value set.
      Specified by:
      getValue in interface Map.Entry<K,V>
    • setValue

      public V setValue(V value)
      Sets the new value and returns the old one. This method is useful for storage when deserializing cyclic object graphs.
      Specified by:
      setValue in interface Map.Entry<K,V>
    • put

      public void put(K key, V value)
      Puts the key-value entry.