Enum MapField.StorageMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MapField.StorageMode>
    Enclosing class:
    MapField<K,​V>

    private static enum MapField.StorageMode
    extends java.lang.Enum<MapField.StorageMode>
    Indicates where the data of this map field is currently stored.
    • MAP: Data is stored in mapData.
    • LIST: Data is stored in listData.
    • BOTH: mapData and listData have the same data.

    When the map field is accessed (through generated API or reflection API), it will shift between these 3 modes:

              getMap()   getList()    getMutableMap()   getMutableList()
     MAP      MAP        BOTH         MAP               LIST
     LIST     BOTH       LIST         MAP               LIST
     BOTH     BOTH       BOTH         MAP               LIST
     

    As the map field changes its mode, the list/map reference returned in a previous method call may be invalidated.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOTH  
      LIST  
      MAP  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StorageMode()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MapField.StorageMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MapField.StorageMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StorageMode

        private StorageMode()
    • Method Detail

      • values

        public static MapField.StorageMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MapField.StorageMode c : MapField.StorageMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MapField.StorageMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null