Package com.google.protobuf
Class Type
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
-
- com.google.protobuf.GeneratedMessageLite<Type,Type.Builder>
-
- com.google.protobuf.Type
-
- All Implemented Interfaces:
MessageLite
,MessageLiteOrBuilder
,TypeOrBuilder
public final class Type extends GeneratedMessageLite<Type,Type.Builder> implements TypeOrBuilder
A protocol buffer message type.
Protobuf typegoogle.protobuf.Type
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Type.Builder
A protocol buffer message type.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite
GeneratedMessageLite.DefaultInstanceBasedParser<T extends GeneratedMessageLite<T,?>>, GeneratedMessageLite.ExtendableBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessage<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtensionDescriptor, GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>, GeneratedMessageLite.MethodToInvoke, GeneratedMessageLite.SerializedForm
-
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
AbstractMessageLite.InternalOneOfEnum
-
-
Field Summary
Fields Modifier and Type Field Description private static Type
DEFAULT_INSTANCE
private Internal.ProtobufList<Field>
fields_
static int
FIELDS_FIELD_NUMBER
private java.lang.String
name_
static int
NAME_FIELD_NUMBER
private Internal.ProtobufList<java.lang.String>
oneofs_
static int
ONEOFS_FIELD_NUMBER
private Internal.ProtobufList<Option>
options_
static int
OPTIONS_FIELD_NUMBER
private static Parser<Type>
PARSER
static int
SOURCE_CONTEXT_FIELD_NUMBER
private SourceContext
sourceContext_
private int
syntax_
static int
SYNTAX_FIELD_NUMBER
-
Fields inherited from class com.google.protobuf.GeneratedMessageLite
UNINITIALIZED_HASH_CODE, UNINITIALIZED_SERIALIZED_SIZE, unknownFields
-
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Type()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addAllFields(java.lang.Iterable<? extends Field> values)
The list of fields.private void
addAllOneofs(java.lang.Iterable<java.lang.String> values)
The list of types appearing in `oneof` definitions in this type.private void
addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.private void
addFields(int index, Field value)
The list of fields.private void
addFields(Field value)
The list of fields.private void
addOneofs(java.lang.String value)
The list of types appearing in `oneof` definitions in this type.private void
addOneofsBytes(ByteString value)
The list of types appearing in `oneof` definitions in this type.private void
addOptions(int index, Option value)
The protocol buffer options.private void
addOptions(Option value)
The protocol buffer options.private void
clearFields()
The list of fields.private void
clearName()
The fully qualified message name.private void
clearOneofs()
The list of types appearing in `oneof` definitions in this type.private void
clearOptions()
The protocol buffer options.private void
clearSourceContext()
The source context.private void
clearSyntax()
The source syntax.protected java.lang.Object
dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.Object arg1)
A method that implements different types of operations described inGeneratedMessageLite.MethodToInvoke
.private void
ensureFieldsIsMutable()
private void
ensureOneofsIsMutable()
private void
ensureOptionsIsMutable()
static Type
getDefaultInstance()
Field
getFields(int index)
The list of fields.int
getFieldsCount()
The list of fields.java.util.List<Field>
getFieldsList()
The list of fields.FieldOrBuilder
getFieldsOrBuilder(int index)
The list of fields.java.util.List<? extends FieldOrBuilder>
getFieldsOrBuilderList()
The list of fields.java.lang.String
getName()
The fully qualified message name.ByteString
getNameBytes()
The fully qualified message name.java.lang.String
getOneofs(int index)
The list of types appearing in `oneof` definitions in this type.ByteString
getOneofsBytes(int index)
The list of types appearing in `oneof` definitions in this type.int
getOneofsCount()
The list of types appearing in `oneof` definitions in this type.java.util.List<java.lang.String>
getOneofsList()
The list of types appearing in `oneof` definitions in this type.Option
getOptions(int index)
The protocol buffer options.int
getOptionsCount()
The protocol buffer options.java.util.List<Option>
getOptionsList()
The protocol buffer options.OptionOrBuilder
getOptionsOrBuilder(int index)
The protocol buffer options.java.util.List<? extends OptionOrBuilder>
getOptionsOrBuilderList()
The protocol buffer options.SourceContext
getSourceContext()
The source context.Syntax
getSyntax()
The source syntax.int
getSyntaxValue()
The source syntax.boolean
hasSourceContext()
The source context.private void
mergeSourceContext(SourceContext value)
The source context.static Type.Builder
newBuilder()
static Type.Builder
newBuilder(Type prototype)
static Type
parseDelimitedFrom(java.io.InputStream input)
static Type
parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry)
static Type
parseFrom(byte[] data)
static Type
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
static Type
parseFrom(ByteString data)
static Type
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
static Type
parseFrom(CodedInputStream input)
static Type
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
static Type
parseFrom(java.io.InputStream input)
static Type
parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry)
static Type
parseFrom(java.nio.ByteBuffer data)
static Type
parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry)
static Parser<Type>
parser()
private void
removeFields(int index)
The list of fields.private void
removeOptions(int index)
The protocol buffer options.private void
setFields(int index, Field value)
The list of fields.private void
setName(java.lang.String value)
The fully qualified message name.private void
setNameBytes(ByteString value)
The fully qualified message name.private void
setOneofs(int index, java.lang.String value)
The list of types appearing in `oneof` definitions in this type.private void
setOptions(int index, Option value)
The protocol buffer options.private void
setSourceContext(SourceContext value)
The source context.private void
setSyntax(Syntax value)
The source syntax.private void
setSyntaxValue(int value)
The source syntax.-
Methods inherited from class com.google.protobuf.GeneratedMessageLite
buildMessageInfo, clearMemoizedHashCode, clearMemoizedSerializedSize, computeHashCode, createBuilder, createBuilder, dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstance, getDefaultInstanceForType, getMemoizedHashCode, getMemoizedSerializedSize, getMethodOrDie, getParserForType, getSerializedSize, getSerializedSize, hashCode, hashCodeIsNotMemoized, invokeOrDie, isInitialized, isInitialized, isMutable, makeImmutable, markImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newMutableInstance, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, setMemoizedHashCode, setMemoizedSerializedSize, toBuilder, toString, writeTo
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, newUninitializedMessageException, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
-
-
-
Field Detail
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
name_
private java.lang.String name_
-
FIELDS_FIELD_NUMBER
public static final int FIELDS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
fields_
private Internal.ProtobufList<Field> fields_
-
ONEOFS_FIELD_NUMBER
public static final int ONEOFS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
oneofs_
private Internal.ProtobufList<java.lang.String> oneofs_
-
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
options_
private Internal.ProtobufList<Option> options_
-
SOURCE_CONTEXT_FIELD_NUMBER
public static final int SOURCE_CONTEXT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
sourceContext_
private SourceContext sourceContext_
-
SYNTAX_FIELD_NUMBER
public static final int SYNTAX_FIELD_NUMBER
- See Also:
- Constant Field Values
-
syntax_
private int syntax_
-
DEFAULT_INSTANCE
private static final Type DEFAULT_INSTANCE
-
-
Method Detail
-
getName
public java.lang.String getName()
The fully qualified message name.
string name = 1;
- Specified by:
getName
in interfaceTypeOrBuilder
- Returns:
- The name.
-
getNameBytes
public ByteString getNameBytes()
The fully qualified message name.
string name = 1;
- Specified by:
getNameBytes
in interfaceTypeOrBuilder
- Returns:
- The bytes for name.
-
setName
private void setName(java.lang.String value)
The fully qualified message name.
string name = 1;
- Parameters:
value
- The name to set.
-
clearName
private void clearName()
The fully qualified message name.
string name = 1;
-
setNameBytes
private void setNameBytes(ByteString value)
The fully qualified message name.
string name = 1;
- Parameters:
value
- The bytes for name to set.
-
getFieldsList
public java.util.List<Field> getFieldsList()
The list of fields.
repeated .google.protobuf.Field fields = 2;
- Specified by:
getFieldsList
in interfaceTypeOrBuilder
-
getFieldsOrBuilderList
public java.util.List<? extends FieldOrBuilder> getFieldsOrBuilderList()
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
getFieldsCount
public int getFieldsCount()
The list of fields.
repeated .google.protobuf.Field fields = 2;
- Specified by:
getFieldsCount
in interfaceTypeOrBuilder
-
getFields
public Field getFields(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;
- Specified by:
getFields
in interfaceTypeOrBuilder
-
getFieldsOrBuilder
public FieldOrBuilder getFieldsOrBuilder(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
ensureFieldsIsMutable
private void ensureFieldsIsMutable()
-
setFields
private void setFields(int index, Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
addFields
private void addFields(Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
addFields
private void addFields(int index, Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
addAllFields
private void addAllFields(java.lang.Iterable<? extends Field> values)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
clearFields
private void clearFields()
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
removeFields
private void removeFields(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;
-
getOneofsList
public java.util.List<java.lang.String> getOneofsList()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Specified by:
getOneofsList
in interfaceTypeOrBuilder
- Returns:
- A list containing the oneofs.
-
getOneofsCount
public int getOneofsCount()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Specified by:
getOneofsCount
in interfaceTypeOrBuilder
- Returns:
- The count of oneofs.
-
getOneofs
public java.lang.String getOneofs(int index)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Specified by:
getOneofs
in interfaceTypeOrBuilder
- Parameters:
index
- The index of the element to return.- Returns:
- The oneofs at the given index.
-
getOneofsBytes
public ByteString getOneofsBytes(int index)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Specified by:
getOneofsBytes
in interfaceTypeOrBuilder
- Parameters:
index
- The index of the value to return.- Returns:
- The bytes of the oneofs at the given index.
-
ensureOneofsIsMutable
private void ensureOneofsIsMutable()
-
setOneofs
private void setOneofs(int index, java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Parameters:
index
- The index to set the value at.value
- The oneofs to set.
-
addOneofs
private void addOneofs(java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Parameters:
value
- The oneofs to add.
-
addAllOneofs
private void addAllOneofs(java.lang.Iterable<java.lang.String> values)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Parameters:
values
- The oneofs to add.
-
clearOneofs
private void clearOneofs()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
-
addOneofsBytes
private void addOneofsBytes(ByteString value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
- Parameters:
value
- The bytes of the oneofs to add.
-
getOptionsList
public java.util.List<Option> getOptionsList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
- Specified by:
getOptionsList
in interfaceTypeOrBuilder
-
getOptionsOrBuilderList
public java.util.List<? extends OptionOrBuilder> getOptionsOrBuilderList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
getOptionsCount
public int getOptionsCount()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
- Specified by:
getOptionsCount
in interfaceTypeOrBuilder
-
getOptions
public Option getOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
- Specified by:
getOptions
in interfaceTypeOrBuilder
-
getOptionsOrBuilder
public OptionOrBuilder getOptionsOrBuilder(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
ensureOptionsIsMutable
private void ensureOptionsIsMutable()
-
setOptions
private void setOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
addOptions
private void addOptions(Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
addOptions
private void addOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
addAllOptions
private void addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
clearOptions
private void clearOptions()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
removeOptions
private void removeOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
-
hasSourceContext
public boolean hasSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;
- Specified by:
hasSourceContext
in interfaceTypeOrBuilder
- Returns:
- Whether the sourceContext field is set.
-
getSourceContext
public SourceContext getSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;
- Specified by:
getSourceContext
in interfaceTypeOrBuilder
- Returns:
- The sourceContext.
-
setSourceContext
private void setSourceContext(SourceContext value)
The source context.
.google.protobuf.SourceContext source_context = 5;
-
mergeSourceContext
private void mergeSourceContext(SourceContext value)
The source context.
.google.protobuf.SourceContext source_context = 5;
-
clearSourceContext
private void clearSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;
-
getSyntaxValue
public int getSyntaxValue()
The source syntax.
.google.protobuf.Syntax syntax = 6;
- Specified by:
getSyntaxValue
in interfaceTypeOrBuilder
- Returns:
- The enum numeric value on the wire for syntax.
-
getSyntax
public Syntax getSyntax()
The source syntax.
.google.protobuf.Syntax syntax = 6;
- Specified by:
getSyntax
in interfaceTypeOrBuilder
- Returns:
- The syntax.
-
setSyntaxValue
private void setSyntaxValue(int value)
The source syntax.
.google.protobuf.Syntax syntax = 6;
- Parameters:
value
- The enum numeric value on the wire for syntax to set.
-
setSyntax
private void setSyntax(Syntax value)
The source syntax.
.google.protobuf.Syntax syntax = 6;
- Parameters:
value
- The syntax to set.
-
clearSyntax
private void clearSyntax()
The source syntax.
.google.protobuf.Syntax syntax = 6;
-
parseFrom
public static Type parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(ByteString data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(byte[] data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Type parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static Type parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static Type parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Type parseFrom(CodedInputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Type parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
newBuilder
public static Type.Builder newBuilder()
-
newBuilder
public static Type.Builder newBuilder(Type prototype)
-
dynamicMethod
protected final java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.Object arg1)
Description copied from class:GeneratedMessageLite
A method that implements different types of operations described inGeneratedMessageLite.MethodToInvoke
. These different kinds of operations are required to implement message-level operations for builders in the runtime. This method bundles those operations to reduce the generated methods count.NEW_INSTANCE
returns a new instance of the protocol buffer that has not yet been made immutable. SeeMAKE_IMMUTABLE
.IS_INITIALIZED
returnsnull
for false and the default instance for true. It doesn't use or modify any memoized value.GET_MEMOIZED_IS_INITIALIZED
returns the memoizedisInitialized
byte value.SET_MEMOIZED_IS_INITIALIZED
sets the memoizedisInitialized
byte value to 1 if the first parameter is not null, or to 0 if the first parameter is null.NEW_BUILDER
returns aBuilderType
instance.
For use by generated code only.
- Specified by:
dynamicMethod
in classGeneratedMessageLite<Type,Type.Builder>
-
getDefaultInstance
public static Type getDefaultInstance()
-
-