Message and Message.Builder to provide type
equivalency.
| Modifier and Type | Method and Description |
|---|---|
| public List | findInitializationErrors()
Returns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message. |
| public Map | getAllFields()
Returns a collection of all the fields in this message which are set and their corresponding values. |
| public Message | getDefaultInstanceForType()
Redeclares com. |
| public Descriptors. | |
| public Object | getField(Descriptors.
Obtains the value of the given field, or the default value if it is not set. |
| public String | getInitializationErrorString()
Returns a comma-delimited list of required fields which are not set in this message object. |
| public Descriptors. | getOneofFieldDescriptor(Descriptors.
Obtains the FieldDescriptor if the given oneof is set. |
| public Object | |
| public int | getRepeatedFieldCount(Descriptors.
Gets the number of elements of a repeated field. |
| public UnknownFieldSet | |
| public boolean | |
| public boolean |
| findInitializationErrors | back to summary |
|---|---|
| public List Returns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this
message. You should call | |
| getAllFields | back to summary |
|---|---|
| public Map 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 Message getDefaultInstanceForType() Redeclares 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. Get the message's type's descriptor. This differs from the | |
| getField | back to summary |
|---|---|
| public Object getField(Descriptors. 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. | |
| getInitializationErrorString | back to summary |
|---|---|
| public String getInitializationErrorString() Returns a comma-delimited list of required fields which are not set in this message object. You
should call | |
| getOneofFieldDescriptor | back to summary |
|---|---|
| public Descriptors. Obtains the FieldDescriptor if the given oneof is set. Returns null if no field is set. | |
| getRepeatedField | back to summary |
|---|---|
| public Object getRepeatedField(Descriptors. 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. 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() Get the | |
| hasField | back to summary |
|---|---|
| public boolean hasField(Descriptors. Returns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field.
| |
| hasOneof | back to summary |
|---|---|
| public boolean hasOneof(Descriptors. Returns true if the given oneof is set.
| |