public final class Option extends GeneratedMessage implements OptionOrBuilder
google.protobuf.Option
Proto option attached to messages/fields/enums etc.
Modifier and Type | Class and Description |
---|---|
static class |
Option.Builder
Protobuf type
google.protobuf.Option |
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 |
NAME_FIELD_NUMBER |
static Parser<Option> |
PARSER |
static int |
VALUE_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
static Option |
getDefaultInstance() |
Option |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
String |
getName()
optional string name = 1; |
ByteString |
getNameBytes()
optional string name = 1; |
Parser<Option> |
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.
|
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message. |
Any |
getValue()
optional .google.protobuf.Any value = 2; |
AnyOrBuilder |
getValueOrBuilder()
optional .google.protobuf.Any value = 2; |
boolean |
hasValue()
optional .google.protobuf.Any value = 2; |
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 Option.Builder |
newBuilder() |
static Option.Builder |
newBuilder(Option prototype) |
Option.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected Option.Builder |
newBuilderForType(GeneratedMessage.BuilderParent parent) |
static Option |
parseDelimitedFrom(InputStream input) |
static Option |
parseDelimitedFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Option |
parseFrom(byte[] data) |
static Option |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Option |
parseFrom(ByteString data) |
static Option |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static Option |
parseFrom(CodedInputStream input) |
static Option |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static Option |
parseFrom(InputStream input) |
static Option |
parseFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
Option.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, writeReplace
equals, findInitializationErrors, getInitializationErrorString, hashCode, hashFields, toString
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int NAME_FIELD_NUMBER
public static final int VALUE_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
MessageOrBuilder
UnknownFieldSet
for this message.getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessage
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessage
internalGetFieldAccessorTable
in class GeneratedMessage
public String getName()
optional string name = 1;
Proto option name.
getName
in interface OptionOrBuilder
public ByteString getNameBytes()
optional string name = 1;
Proto option name.
getNameBytes
in interface OptionOrBuilder
public boolean hasValue()
optional .google.protobuf.Any value = 2;
Proto option value.
hasValue
in interface OptionOrBuilder
public Any getValue()
optional .google.protobuf.Any value = 2;
Proto option value.
getValue
in interface OptionOrBuilder
public AnyOrBuilder getValueOrBuilder()
optional .google.protobuf.Any value = 2;
Proto option value.
getValueOrBuilder
in interface OptionOrBuilder
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessage
public void writeTo(CodedOutputStream output) throws IOException
MessageLite
output
. This does not
flush or close the stream.writeTo
in interface MessageLite
writeTo
in class GeneratedMessage
IOException
public int getSerializedSize()
MessageLite
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessage
public static Option parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Option parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Option parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Option parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Option parseFrom(InputStream input) throws IOException
IOException
public static Option parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Option parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Option parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Option parseFrom(CodedInputStream input) throws IOException
IOException
public static Option parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Option.Builder newBuilderForType()
MessageLite
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Option.Builder newBuilder()
public static Option.Builder newBuilder(Option prototype)
public Option.Builder toBuilder()
MessageLite
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Option.Builder newBuilderForType(GeneratedMessage.BuilderParent parent)
newBuilderForType
in class GeneratedMessage
public static Option getDefaultInstance()
public Parser<Option> getParserForType()
MessageLite
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessage
public Option getDefaultInstanceForType()
MessageLiteOrBuilder
getDefaultInstance()
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 MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2008–2015 Google. All rights reserved.