In reflection API, map fields will be treated as repeated message fields and each map entry is accessed as a message. This MapEntry class is used to represent these map entry messages in reflection API.
Protobuf internal. Users shouldn't use this class.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private volatile int | |
| private final K | |
| private final MapEntry. | |
| private final V |
| Access | Constructor and Description |
|---|---|
| private | MapEntry(Descriptors.
Create a default MapEntry instance. |
| private | |
| private | MapEntry(MapEntry.
Parsing constructor. |
| cachedSerializedSize | back to summary |
|---|---|
| private volatile int cachedSerializedSize | |
| key | back to summary |
|---|---|
| private final K key | |
| metadata | back to summary |
|---|---|
| private final MapEntry. | |
| value | back to summary |
|---|---|
| private final V value | |
| MapEntry | back to summary |
|---|---|
| private MapEntry(Descriptors. Create a default MapEntry instance. | |
| MapEntry | back to summary |
|---|---|
| private MapEntry(MapEntry. Create a MapEntry with the provided key and value.
| |
| MapEntry | back to summary |
|---|---|
| private MapEntry(MapEntry. Parsing constructor. | |
| checkFieldDescriptor | back to summary |
|---|---|
| private void checkFieldDescriptor(Descriptors. | |
| getAllFields | back to summary |
|---|---|
| public Map Implements com. Doc from com. Returns a collection of all the fields in this message which are set and their corresponding
values. A singular ("required" or "optional") field is set iff hasField() returns true for that
field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values
are exactly what would be returned by calling
| |
| getDefaultInstanceForType | back to summary |
|---|---|
| public MapEntry Implements com. Doc from com. Get an instance of the type with no fields set. Because no fields are set, all getters for
singular fields will return default values and repeated fields will appear empty. This may or
may not be a singleton. This differs from the
| |
| getDescriptorForType | back to summary |
|---|---|
| public Descriptors. Implements com. Doc from com. Get the message's type's descriptor. This differs from the
| |
| getField | back to summary |
|---|---|
| public Object getField(Descriptors. Implements com. Doc from com. Obtains the value of the given field, or the default value if it is not set. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned. For repeated fields, a java.util.List is returned.
| |
| getKey | back to summary |
|---|---|
| public K getKey() | |
| getMetadata | back to summary |
|---|---|
| pack-priv final MapEntry. Returns the metadata only for experimental runtime. | |
| getParserForType | back to summary |
|---|---|
| public Parser Implements com. Doc from com. Gets the parser for a message of the same type as this message.
| |
| getRepeatedField | back to summary |
|---|---|
| public Object getRepeatedField(Descriptors. Implements com. Doc from com. Gets an element of a repeated field. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned.
| |
| getRepeatedFieldCount | back to summary |
|---|---|
| public int getRepeatedFieldCount(Descriptors. Implements com. Doc from com. Gets the number of elements of a repeated field. This is exactly equivalent to calling the generated "Count" accessor method corresponding to the field.
| |
| getSerializedSize | back to summary |
|---|---|
| public int getSerializedSize() Overrides com. Implements com. Doc from com. Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.
| |
| getUnknownFields | back to summary |
|---|---|
| public UnknownFieldSet getUnknownFields() Implements com. Doc from com. Get the
| |
| getValue | back to summary |
|---|---|
| public V getValue() | |
| hasField | back to summary |
|---|---|
| public boolean hasField(Descriptors. Implements com. Doc from com. Returns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field.
| |
| isInitialized | back to summary |
|---|---|
| public boolean isInitialized() Overrides com. Implements com. Doc from com. Returns true if all required fields in the message and all embedded messages are set, false otherwise. See also:
| |
| isInitialized | back to summary |
|---|---|
| private static <V> boolean isInitialized(MapEntry. | |
| newBuilderForType | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Constructs a new builder for a message of the same type as this message.
| |
| newDefaultInstance | back to summary |
|---|---|
| public static <K, V> MapEntry Create a default MapEntry instance. A default MapEntry instance should be created only once for each map entry message type. Generated code should store the created default instance and use it later to create new MapEntry messages of the same type. | |
| toBuilder | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Constructs a builder initialized with the current message. Use this to derive a new message from the current one.
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(CodedOutputStream output) throws IOException Overrides com. Implements com. Doc from com. Serializes the message and writes it to
| |
MapEntry messages.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private K | |
| private final MapEntry. | |
| private V |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| hasKey | back to summary |
|---|---|
| private boolean hasKey | |
| hasValue | back to summary |
|---|---|
| private boolean hasValue | |
| key | back to summary |
|---|---|
| private K key | |
| metadata | back to summary |
|---|---|
| private final MapEntry. | |
| value | back to summary |
|---|---|
| private V value | |
| Builder | back to summary |
|---|---|
| private Builder(MapEntry. | |
| Builder | back to summary |
|---|---|
| private Builder(MapEntry. | |
| addRepeatedField | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Like
| |
| build | back to summary |
|---|---|
| public MapEntry Implements com. Doc from com. Constructs the message based on the state of the Builder. Subsequent changes to the Builder will not affect the returned message.
| |
| buildPartial | back to summary |
|---|---|
| public MapEntry Implements com. Doc from com. Like
| |
| checkFieldDescriptor | back to summary |
|---|---|
| private void checkFieldDescriptor(Descriptors. | |
| clearField | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Clears the field. This is exactly equivalent to calling the generated "clear" accessor method corresponding to the field.
| |
| clearKey | back to summary |
|---|---|
| public MapEntry. | |
| clearValue | back to summary |
|---|---|
| public MapEntry. | |
| clone | back to summary |
|---|---|
| public MapEntry. Overrides com. Implements com. Doc from com. Clones the Builder.
| |
| getAllFields | back to summary |
|---|---|
| public Map Implements com. Doc from com. Returns a collection of all the fields in this message which are set and their corresponding
values. A singular ("required" or "optional") field is set iff hasField() returns true for that
field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values
are exactly what would be returned by calling
| |
| getDefaultInstanceForType | back to summary |
|---|---|
| public MapEntry Implements com. Doc from com. Get an instance of the type with no fields set. Because no fields are set, all getters for
singular fields will return default values and repeated fields will appear empty. This may or
may not be a singleton. This differs from the
| |
| getDescriptorForType | back to summary |
|---|---|
| public Descriptors. Implements com. Doc from com. Get the message's type's descriptor. See
| |
| getField | back to summary |
|---|---|
| public Object getField(Descriptors. Implements com. Doc from com. Obtains the value of the given field, or the default value if it is not set. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned. For repeated fields, a java.util.List is returned.
| |
| getKey | back to summary |
|---|---|
| public K getKey() | |
| getRepeatedField | back to summary |
|---|---|
| public Object getRepeatedField(Descriptors. Implements com. Doc from com. Gets an element of a repeated field. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned.
| |
| getRepeatedFieldCount | back to summary |
|---|---|
| public int getRepeatedFieldCount(Descriptors. Implements com. Doc from com. Gets the number of elements of a repeated field. This is exactly equivalent to calling the generated "Count" accessor method corresponding to the field.
| |
| getUnknownFields | back to summary |
|---|---|
| public UnknownFieldSet getUnknownFields() Implements com. Doc from com. Get the
| |
| getValue | back to summary |
|---|---|
| public V getValue() | |
| hasField | back to summary |
|---|---|
| public boolean hasField(Descriptors. Implements com. Doc from com. Returns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field.
| |
| isInitialized | back to summary |
|---|---|
| public boolean isInitialized() Implements com. Doc from com. Returns true if all required fields in the message and all embedded messages are set, false otherwise. See also:
| |
| newBuilderForField | back to summary |
|---|---|
| public Message. Implements com. Doc from com. Create a builder for messages of the appropriate type for the given field. The
builder is NOT nested in the current builder. However, messages built with the
builder can then be passed to the To obtain a builder nested in the current builder, use
| |
| setField | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Sets a field to the given value. The value must be of the correct type for this field, i.e.
the same type that
| |
| setKey | back to summary |
|---|---|
| public MapEntry. | |
| setRepeatedField | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Sets an element of a repeated field to the given value. The value must be of the correct type
for this field, i.e. the same type that
| |
| setUnknownFields | back to summary |
|---|---|
| public MapEntry. Implements com. Doc from com. Set the
| |
| setValue | back to summary |
|---|---|
| public MapEntry. | |
| Modifier and Type | Field and Description |
|---|---|
| public final Descriptors. | |
| public final Parser |
| Access | Constructor and Description |
|---|---|
| public | Metadata(Descriptors.
|
| descriptor | back to summary |
|---|---|
| public final Descriptors. | |
| parser | back to summary |
|---|---|
| public final Parser<MapEntry<K, V>> parser | |
| Metadata | back to summary |
|---|---|
| public Metadata(Descriptors. | |