public final class Field extends GeneratedMessage implements FieldOrBuilder
google.protobuf.Field
Field represents a single field of a message type.
| Modifier and Type | Class and Description |
|---|---|
static class |
Field.Builder
Protobuf type
google.protobuf.Field |
static class |
Field.Cardinality
Protobuf enum
google.protobuf.Field.Cardinality |
static class |
Field.Kind
Protobuf enum
google.protobuf.Field.Kind |
GeneratedMessage.BuilderParent, GeneratedMessage.ExtendableBuilder<MessageType extends GeneratedMessage.ExtendableMessage,BuilderType extends GeneratedMessage.ExtendableBuilder>, GeneratedMessage.ExtendableMessage<MessageType extends GeneratedMessage.ExtendableMessage>, GeneratedMessage.ExtendableMessageOrBuilder<MessageType extends GeneratedMessage.ExtendableMessage>, GeneratedMessage.FieldAccessorTable, GeneratedMessage.GeneratedExtension<ContainingType extends Message,Type>| Modifier and Type | Field and Description |
|---|---|
static int |
CARDINALITY_FIELD_NUMBER |
static int |
KIND_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
NUMBER_FIELD_NUMBER |
static int |
ONEOF_INDEX_FIELD_NUMBER |
static int |
OPTIONS_FIELD_NUMBER |
static int |
PACKED_FIELD_NUMBER |
static Parser<Field> |
PARSER |
static int |
TYPE_URL_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
Field.Cardinality |
getCardinality()
optional .google.protobuf.Field.Cardinality cardinality = 2; |
int |
getCardinalityValue()
optional .google.protobuf.Field.Cardinality cardinality = 2; |
static Field |
getDefaultInstance() |
Field |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
Field.Kind |
getKind()
optional .google.protobuf.Field.Kind kind = 1; |
int |
getKindValue()
optional .google.protobuf.Field.Kind kind = 1; |
String |
getName()
optional string name = 4; |
ByteString |
getNameBytes()
optional string name = 4; |
int |
getNumber()
optional int32 number = 3; |
int |
getOneofIndex()
optional int32 oneof_index = 7; |
Option |
getOptions(int index)
repeated .google.protobuf.Option options = 9; |
int |
getOptionsCount()
repeated .google.protobuf.Option options = 9; |
List<Option> |
getOptionsList()
repeated .google.protobuf.Option options = 9; |
OptionOrBuilder |
getOptionsOrBuilder(int index)
repeated .google.protobuf.Option options = 9; |
List<? extends OptionOrBuilder> |
getOptionsOrBuilderList()
repeated .google.protobuf.Option options = 9; |
boolean |
getPacked()
optional bool packed = 8; |
Parser<Field> |
getParserForType()
Gets the parser for a message of the same type as this message.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
String |
getTypeUrl()
optional string type_url = 6; |
ByteString |
getTypeUrlBytes()
optional string type_url = 6; |
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message. |
protected GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded
messages are set, false otherwise.
|
static Field.Builder |
newBuilder() |
static Field.Builder |
newBuilder(Field prototype) |
Field.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected Field.Builder |
newBuilderForType(GeneratedMessage.BuilderParent parent) |
static Field |
parseDelimitedFrom(InputStream input) |
static Field |
parseDelimitedFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(byte[] data) |
static Field |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(ByteString data) |
static Field |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(CodedInputStream input) |
static Field |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(InputStream input) |
static Field |
parseFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
Field.Builder |
toBuilder()
Constructs a builder initialized with the current message.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output. |
getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newFileScopedGeneratedExtension, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownField, writeReplaceequals, findInitializationErrors, getInitializationErrorString, hashCode, hashFields, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int KIND_FIELD_NUMBER
public static final int CARDINALITY_FIELD_NUMBER
public static final int NUMBER_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
public static final int TYPE_URL_FIELD_NUMBER
public static final int ONEOF_INDEX_FIELD_NUMBER
public static final int PACKED_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
MessageOrBuilderUnknownFieldSet for this message.getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessagepublic static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessageinternalGetFieldAccessorTable in class GeneratedMessagepublic int getKindValue()
optional .google.protobuf.Field.Kind kind = 1;
The field kind.
getKindValue in interface FieldOrBuilderpublic Field.Kind getKind()
optional .google.protobuf.Field.Kind kind = 1;
The field kind.
getKind in interface FieldOrBuilderpublic int getCardinalityValue()
optional .google.protobuf.Field.Cardinality cardinality = 2;
The field cardinality, i.e. optional/required/repeated.
getCardinalityValue in interface FieldOrBuilderpublic Field.Cardinality getCardinality()
optional .google.protobuf.Field.Cardinality cardinality = 2;
The field cardinality, i.e. optional/required/repeated.
getCardinality in interface FieldOrBuilderpublic int getNumber()
optional int32 number = 3;
The proto field number.
getNumber in interface FieldOrBuilderpublic String getName()
optional string name = 4;
The field name.
getName in interface FieldOrBuilderpublic ByteString getNameBytes()
optional string name = 4;
The field name.
getNameBytes in interface FieldOrBuilderpublic String getTypeUrl()
optional string type_url = 6;
The type URL (without the scheme) when the type is MESSAGE or ENUM, such as `type.googleapis.com/google.protobuf.Empty`.
getTypeUrl in interface FieldOrBuilderpublic ByteString getTypeUrlBytes()
optional string type_url = 6;
The type URL (without the scheme) when the type is MESSAGE or ENUM, such as `type.googleapis.com/google.protobuf.Empty`.
getTypeUrlBytes in interface FieldOrBuilderpublic int getOneofIndex()
optional int32 oneof_index = 7;
Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
getOneofIndex in interface FieldOrBuilderpublic boolean getPacked()
optional bool packed = 8;
Whether to use alternative packed wire representation.
getPacked in interface FieldOrBuilderpublic List<Option> getOptionsList()
repeated .google.protobuf.Option options = 9;
The proto options.
getOptionsList in interface FieldOrBuilderpublic List<? extends OptionOrBuilder> getOptionsOrBuilderList()
repeated .google.protobuf.Option options = 9;
The proto options.
getOptionsOrBuilderList in interface FieldOrBuilderpublic int getOptionsCount()
repeated .google.protobuf.Option options = 9;
The proto options.
getOptionsCount in interface FieldOrBuilderpublic Option getOptions(int index)
repeated .google.protobuf.Option options = 9;
The proto options.
getOptions in interface FieldOrBuilderpublic OptionOrBuilder getOptionsOrBuilder(int index)
repeated .google.protobuf.Option options = 9;
The proto options.
getOptionsOrBuilder in interface FieldOrBuilderpublic final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessagepublic void writeTo(CodedOutputStream output) throws IOException
MessageLiteoutput. This does not
flush or close the stream.writeTo in interface MessageLitewriteTo in class GeneratedMessageIOExceptionpublic int getSerializedSize()
MessageLitegetSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessagepublic static Field parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Field parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Field parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Field parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Field parseFrom(InputStream input) throws IOException
IOExceptionpublic static Field parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Field parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static Field parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Field parseFrom(CodedInputStream input) throws IOException
IOExceptionpublic static Field parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic Field.Builder newBuilderForType()
MessageLitenewBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static Field.Builder newBuilder()
public static Field.Builder newBuilder(Field prototype)
public Field.Builder toBuilder()
MessageLitetoBuilder in interface MessagetoBuilder in interface MessageLiteprotected Field.Builder newBuilderForType(GeneratedMessage.BuilderParent parent)
newBuilderForType in class GeneratedMessagepublic static Field getDefaultInstance()
public Parser<Field> getParserForType()
MessageLitegetParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessagepublic Field getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() method of generated message classes in that
this method is an abstract method of the MessageLite interface
whereas getDefaultInstance() is a static method of a specific
class. They return the same thing.getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilderCopyright © 2008–2015 Google. All rights reserved.