Go to the documentation of this file.
31 package com.google.protobuf;
39 import java.io.IOException;
40 import java.io.InputStream;
41 import java.util.Collections;
42 import java.util.List;
53 private final FieldSet<FieldDescriptor>
fields;
68 FieldSet<FieldDescriptor>
fields,
79 int oneofDeclCount =
type.toProto().getOneofDeclCount();
167 return fields.getAllFields();
196 if (result ==
null) {
197 if (
field.isRepeated()) {
198 result = Collections.emptyList();
202 result =
field.getDefaultValue();
228 if (
field.isRequired()) {
236 return fields.isInitialized();
246 if (
type.getOptions().getMessageSetWireFormat()) {
260 if (
type.getOptions().getMessageSetWireFormat()) {
294 }
catch (IOException e) {
305 throw new IllegalArgumentException(
"FieldDescriptor does not match message type.");
312 throw new IllegalArgumentException(
"OneofDescriptor does not match message type.");
321 private FieldSet<FieldDescriptor>
fields;
328 this.fields = FieldSet.newFieldSet();
332 if (
type.getOptions().getMapEntry()) {
352 if (
fields.isImmutable()) {
353 fields = FieldSet.newFieldSet();
358 if (
type.getOptions().getMapEntry()) {
370 if (otherDynamicMessage.
type !=
type) {
371 throw new IllegalArgumentException(
372 "mergeFrom(Message) can only merge messages of the same type.");
390 return super.mergeFrom(other);
459 return fields.getAllFields();
467 throw new IllegalArgumentException(
468 "newBuilderForField is only valid for fields with message type.");
510 if (result ==
null) {
511 if (
field.isRepeated()) {
512 result = Collections.emptyList();
516 result =
field.getDefaultValue();
535 if (oneofDescriptor !=
null) {
538 if ((oldField !=
null) && (oldField !=
field)) {
539 fields.clearField(oldField);
543 if (!
field.isRepeated()
560 if (oneofDescriptor !=
null) {
619 throw new IllegalArgumentException(
"FieldDescriptor does not match message type.");
626 throw new IllegalArgumentException(
"OneofDescriptor does not match message type.");
634 throw new IllegalArgumentException(
635 "DynamicMessage should use EnumValueDescriptor to set Enum Value.");
650 if (
field.isRepeated()) {
660 if (
fields.isImmutable()) {
668 throw new UnsupportedOperationException(
669 "getFieldBuilder() called on a dynamic message type.");
675 throw new UnsupportedOperationException(
676 "getRepeatedFieldBuilder() called on a dynamic message type.");
final UnknownFieldSet unknownFields
final FieldSet< FieldDescriptor > fields
FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof)
static UnknownFieldSet getDefaultInstance()
Builder setField(FieldDescriptor field, Object value)
static Builder newBuilder(Message prototype)
void writeTo(CodedOutputStream output)
static DynamicMessage parseFrom(Descriptor type, InputStream input)
Object getField(FieldDescriptor field)
Map< FieldDescriptor, Object > getAllFields()
Builder addRepeatedField(FieldDescriptor field, Object value)
DynamicMessage buildParsed()
Parser< DynamicMessage > getParserForType()
Descriptor getContainingType()
Builder clearOneof(OneofDescriptor oneof)
void ensureEnumValueDescriptor(FieldDescriptor field, Object value)
boolean hasField(FieldDescriptor field)
FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof)
int getRepeatedFieldCount(FieldDescriptor field)
void writeTo(final CodedOutputStream output)
InvalidProtocolBufferException asInvalidProtocolBufferException()
static Builder newBuilder()
int getRepeatedFieldCount(FieldDescriptor field)
void writeAsMessageSetTo(final CodedOutputStream output)
Builder newBuilderForType()
Descriptors.Descriptor getDescriptorForType()
void verifyOneofContainingType(OneofDescriptor oneof)
Descriptor getDescriptorForType()
static Builder newBuilder(Descriptor type)
com.google.protobuf.Message.Builder getFieldBuilder(FieldDescriptor field)
Object getRepeatedField(FieldDescriptor field, int index)
boolean hasField(FieldDescriptor field)
Descriptor getDescriptorForType()
DynamicMessage buildPartial()
com.google.protobuf.Message.Builder getRepeatedFieldBuilder(FieldDescriptor field, int index)
DynamicMessage getDefaultInstanceForType()
DynamicMessage getDefaultInstanceForType()
static DynamicMessage getDefaultInstance(Descriptor type)
Builder mergeFrom(Message other)
static DynamicMessage parseFrom(Descriptor type, InputStream input, ExtensionRegistry extensionRegistry)
void ensureSingularEnumValueDescriptor(FieldDescriptor field, Object value)
boolean hasOneof(OneofDescriptor oneof)
static DynamicMessage parseFrom(Descriptor type, ByteString data)
const FieldDescriptor * field
void verifyOneofContainingType(OneofDescriptor oneof)
static DynamicMessage parseFrom(Descriptor type, ByteString data, ExtensionRegistry extensionRegistry)
Object getField(FieldDescriptor field)
Builder setRepeatedField(FieldDescriptor field, int index, Object value)
final FieldDescriptor[] oneofCases
Builder newBuilderForField(FieldDescriptor field)
static DynamicMessage parseFrom(Descriptor type, byte[] data)
void verifyContainingType(FieldDescriptor field)
FieldSet< FieldDescriptor > fields
UnknownFieldSet unknownFields
final FieldDescriptor[] oneofCases
InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)
int getSerializedSizeAsMessageSet()
Builder setUnknownFields(UnknownFieldSet unknownFields)
static UninitializedMessageException newUninitializedMessageException(Message message)
static DynamicMessage parseFrom(Descriptor type, CodedInputStream input)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void verifyContainingType(FieldDescriptor field)
GLsizei const GLfloat * value
Map< FieldDescriptor, Object > getAllFields()
UnknownFieldSet getUnknownFields()
UnknownFieldSet getUnknownFields()
static DynamicMessage parseFrom(Descriptor type, CodedInputStream input, ExtensionRegistry extensionRegistry)
const upb_json_parsermethod const upb_symtab upb_sink * output
Builder mergeFrom(final UnknownFieldSet other)
Builder clearField(FieldDescriptor field)
static DynamicMessage parseFrom(Descriptor type, byte[] data, ExtensionRegistry extensionRegistry)
Object getRepeatedField(FieldDescriptor field, int index)
Builder mergeUnknownFields(UnknownFieldSet unknownFields)
boolean hasOneof(OneofDescriptor oneof)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:50