public final class Field extends GeneratedMessage implements FieldOrBuilder
google.protobuf.Field
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 |
DEFAULT_VALUE_FIELD_NUMBER |
static int |
JSON_NAME_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 int |
TYPE_URL_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares the specified object with this message for equality.
|
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.
|
String |
getDefaultValue()
optional string default_value = 11; |
ByteString |
getDefaultValueBytes()
optional string default_value = 11; |
static Descriptors.Descriptor |
getDescriptor() |
String |
getJsonName()
optional string json_name = 10; |
ByteString |
getJsonNameBytes()
optional string json_name = 10; |
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. |
int |
hashCode()
Returns the hash code value 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) |
static Parser<Field> |
parser() |
Field.Builder |
toBuilder()
Constructs a builder initialized with the current message.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output. |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newFileScopedGeneratedExtension, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownField, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, 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 static final int JSON_NAME_FIELD_NUMBER
public static final int DEFAULT_VALUE_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 type.
getKindValue in interface FieldOrBuilderpublic Field.Kind getKind()
optional .google.protobuf.Field.Kind kind = 1;
The field type.
getKind in interface FieldOrBuilderpublic int getCardinalityValue()
optional .google.protobuf.Field.Cardinality cardinality = 2;
The field cardinality.
getCardinalityValue in interface FieldOrBuilderpublic Field.Cardinality getCardinality()
optional .google.protobuf.Field.Cardinality cardinality = 2;
The field cardinality.
getCardinality in interface FieldOrBuilderpublic int getNumber()
optional int32 number = 3;
The 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 field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
getTypeUrl in interface FieldOrBuilderpublic ByteString getTypeUrlBytes()
optional string type_url = 6;
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
getTypeUrlBytes in interface FieldOrBuilderpublic int getOneofIndex()
optional int32 oneof_index = 7;
The index of the field type in `Type.oneofs`, for message or enumeration types. The first type has index 1; zero means the type is not in the list.
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 protocol buffer options.
getOptionsList in interface FieldOrBuilderpublic List<? extends OptionOrBuilder> getOptionsOrBuilderList()
repeated .google.protobuf.Option options = 9;
The protocol buffer options.
getOptionsOrBuilderList in interface FieldOrBuilderpublic int getOptionsCount()
repeated .google.protobuf.Option options = 9;
The protocol buffer options.
getOptionsCount in interface FieldOrBuilderpublic Option getOptions(int index)
repeated .google.protobuf.Option options = 9;
The protocol buffer options.
getOptions in interface FieldOrBuilderpublic OptionOrBuilder getOptionsOrBuilder(int index)
repeated .google.protobuf.Option options = 9;
The protocol buffer options.
getOptionsOrBuilder in interface FieldOrBuilderpublic String getJsonName()
optional string json_name = 10;
The field JSON name.
getJsonName in interface FieldOrBuilderpublic ByteString getJsonNameBytes()
optional string json_name = 10;
The field JSON name.
getJsonNameBytes in interface FieldOrBuilderpublic String getDefaultValue()
optional string default_value = 11;
The string value of the default value of this field. Proto2 syntax only.
getDefaultValue in interface FieldOrBuilderpublic ByteString getDefaultValueBytes()
optional string default_value = 11;
The string value of the default value of this field. Proto2 syntax only.
getDefaultValueBytes 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 boolean equals(Object obj)
Messagetrue if the given object is a message of the same type (as
defined by getDescriptorForType()) and has identical values for
all of its fields. Subclasses must implement this; inheriting
Object.equals() is incorrect.equals in interface Messageequals in class AbstractMessageobj - object to be compared for equality with this messagetrue if the specified object is equal to this messagepublic int hashCode()
MessageObject.hashCode() is incorrect.hashCode in interface MessagehashCode in class AbstractMessageMap.hashCode()public 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–2016 Google. All rights reserved.