Package io.protostuff

Class MapSchema.MapWrapper<K,​V>

  • All Implemented Interfaces:
    java.util.Map.Entry<K,​V>
    Enclosing class:
    MapSchema<K,​V>

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

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Map<K,​V> map
      The actual map being operated on.
      (package private) V value
      A temporary storage for the value if the key is not yet available.
    • Constructor Summary

      Constructors 
      Constructor Description
      MapWrapper​(java.util.Map<K,​V> map)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      K getKey()
      The key is provided as the last arg of MapSchema.putValueFrom(Input, MapWrapper, Object).
      V getValue()
      Gets the last value set.
      void put​(K key, V value)
      Puts the key-value entry.
      V setValue​(V value)
      Sets the new value and returns the old one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map.Entry

        equals, hashCode
    • Field Detail

      • map

        final java.util.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 Detail

      • MapWrapper

        MapWrapper​(java.util.Map<K,​V> map)
    • Method Detail

      • getValue

        public V getValue()
        Gets the last value set.
        Specified by:
        getValue in interface java.util.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 java.util.Map.Entry<K,​V>
      • put

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