Enum Class MapField.StorageMode

java.lang.Object
java.lang.Enum<MapField.StorageMode>
com.google.protobuf.MapField.StorageMode
All Implemented Interfaces:
Serializable, Comparable<MapField.StorageMode>, Constable
Enclosing class:
MapField<K,V>

private static enum MapField.StorageMode extends 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 Details

  • Constructor Details

    • StorageMode

      private StorageMode()
  • Method Details

    • values

      public static MapField.StorageMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MapField.StorageMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null