Class MapFieldValue<K extends FieldValue,​V extends FieldValue>

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<FieldValue>, java.util.Map<K,​V>

    public class MapFieldValue<K extends FieldValue,​V extends FieldValue>
    extends CompositeFieldValue
    implements java.util.Map<K,​V>
    Vespa map. Backed by and and parametrized by FieldValue
    Author:
    vegardh
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assign​(java.lang.Object o)
      Assign this non-fieldvalue value to this field value.
      void clear()  
      MapFieldValue clone()  
      int compareTo​(FieldValue fieldValue)  
      boolean contains​(java.lang.Object o)  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      void deserialize​(Field field, FieldReader reader)
      Read a field value from the specified reader
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()  
      boolean equals​(java.lang.Object o)
      Checks if another object is equal to this set.
      V get​(java.lang.Object key)  
      MapDataType getDataType()  
      java.lang.Object getWrappedValue()
      Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values.
      boolean isEmpty()  
      java.util.Set<K> keySet()  
      void printXml​(XmlStream xml)  
      V put​(K key, V value)  
      void putAll​(java.util.Map<? extends K,​? extends V> m)  
      V remove​(java.lang.Object key)  
      void serialize​(Field field, FieldWriter writer)
      Write out field value to the specified writer
      int size()  
      java.util.Collection<V> values()  
      • Methods inherited from class com.yahoo.vespa.objects.Identifiable

        create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getUtf8, onGetClassId, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, toString, visitMembers
      • Methods inherited from class com.yahoo.vespa.objects.Selectable

        select, select, selectMembers
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • MapFieldValue

        public MapFieldValue​(MapDataType type)
      • MapFieldValue

        public MapFieldValue​(MapDataType type,
                             int initialCapacity)
    • Method Detail

      • assign

        public void assign​(java.lang.Object o)
        Description copied from class: FieldValue
        Assign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.

        Override to accept the specific types that should be legal.

        Specified by:
        assign in class FieldValue
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if another object is equal to this set.
        Specified by:
        equals in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
        Overrides:
        equals in class CompositeFieldValue
        Parameters:
        o - the object to check for equality with
        Returns:
        true if o is an instance of WeightedSet and the two encapsulated Maps are equal, false otherwise
      • getWrappedValue

        public java.lang.Object getWrappedValue()
        Description copied from class: FieldValue
        Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themself.
        Overrides:
        getWrappedValue in class FieldValue
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • keySet

        public java.util.Set<K> keySet()
        Specified by:
        keySet in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> m)
        Specified by:
        putAll in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • contains

        public boolean contains​(java.lang.Object o)
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<K extends FieldValue,​V extends FieldValue>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<K extends FieldValue,​V extends FieldValue>