Class Type
- All Implemented Interfaces:
Message, MessageLite, MessageLiteOrBuilder, MessageOrBuilder, TypeOrBuilder, Serializable
A protocol buffer message type. New usages of this message as an alternative to DescriptorProto are strongly discouraged. This message does not reliability preserve all information necessary to model the schema and preserve semantics. Instead make use of FileDescriptorSet which preserves the necessary information.Protobuf type
google.protobuf.Type- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class GeneratedMessage
GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>, GeneratedMessage.ExtendableMessage<MessageT>, GeneratedMessage.ExtendableMessageOrBuilder<MessageT>, GeneratedMessage.ExtensionDescriptorRetriever, GeneratedMessage.FieldAccessorTable, GeneratedMessage.GeneratedExtension<ContainingT, T>, GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class AbstractMessage
AbstractMessage.BuilderParentNested classes/interfaces inherited from class AbstractMessageLite
AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final Typeprivate Objectstatic final intstatic final intprivate byteprivate Objectstatic final intprivate LazyStringArrayListstatic final intstatic final intprivate static final longstatic final intprivate SourceContextprivate intstatic final intFields inherited from class GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, PRE22_GENCODE_ERROR_PROPERTY, PRE22_GENCODE_SILENCE_PROPERTY, PRE22_GENCODE_VULNERABILITY_MESSAGE, unknownFieldsFields inherited from class AbstractMessage
memoizedSizeFields inherited from class AbstractMessageLite
memoizedHashCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the specified object with this message for equality.static TypeGet an instance of the type with no fields set.static final Descriptors.DescriptorGet the message's type's descriptor.The source edition string, only valid when syntax is SYNTAX_EDITIONS.The source edition string, only valid when syntax is SYNTAX_EDITIONS.getFields(int index) The list of fields.intThe list of fields.The list of fields.getFieldsOrBuilder(int index) The list of fields.List<? extends FieldOrBuilder> The list of fields.getName()The fully qualified message name.The fully qualified message name.getOneofs(int index) The list of types appearing in `oneof` definitions in this type.getOneofsBytes(int index) The list of types appearing in `oneof` definitions in this type.intThe list of types appearing in `oneof` definitions in this type.The list of types appearing in `oneof` definitions in this type.getOptions(int index) The protocol buffer options.intThe protocol buffer options.The protocol buffer options.getOptionsOrBuilder(int index) The protocol buffer options.List<? extends OptionOrBuilder> The protocol buffer options.TODO: Remove this unnecessary intermediate implementation of this method.intGet the number of bytes required to encode this message.The source context.The source context.The source syntax.intThe source syntax.inthashCode()Returns the hash code value for this message.booleanThe source context.protected GeneratedMessage.FieldAccessorTableGet the FieldAccessorTable for this type.final booleanReturns true if all required fields in the message and all embedded messages are set, false otherwise.static Type.Builderstatic Type.BuildernewBuilder(Type prototype) Constructs a new builder for a message of the same type as this message.protected Type.BuilderCreate a nested builder.static TypeparseDelimitedFrom(InputStream input) static TypeparseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) static TypeparseFrom(byte[] data) static TypeparseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) static TypeparseFrom(ByteString data) static TypeparseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) static TypeparseFrom(CodedInputStream input) static TypeparseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) static TypeparseFrom(InputStream input) static TypeparseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) static TypeparseFrom(ByteBuffer data) static TypeparseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) parser()Constructs a builder initialized with the current message.voidwriteTo(CodedOutputStream output) Serializes the message and writes it tooutput.Methods inherited from class GeneratedMessage
computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, enableAlwaysUseFieldBuildersForTesting, getAllFields, getAllFieldsRaw, getField, getFieldRaw, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, setAlwaysUseFieldBuildersForTesting, setUnknownFields, warnPre22Gencode, writeReplace, writeString, writeStringNoTagMethods inherited from class AbstractMessage
compareFields, findInitializationErrors, getInitializationErrorString, getMemoizedSerializedSize, hashFields, newUninitializedMessageException, setMemoizedSerializedSize, toStringMethods inherited from class AbstractMessageLite
addAll, checkByteStringIsUtf8, getSerializedSize, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
bitField0_
private int bitField0_ -
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
name_
-
FIELDS_FIELD_NUMBER
public static final int FIELDS_FIELD_NUMBER- See Also:
-
fields_
-
ONEOFS_FIELD_NUMBER
public static final int ONEOFS_FIELD_NUMBER- See Also:
-
oneofs_
-
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER- See Also:
-
options_
-
SOURCE_CONTEXT_FIELD_NUMBER
public static final int SOURCE_CONTEXT_FIELD_NUMBER- See Also:
-
sourceContext_
-
SYNTAX_FIELD_NUMBER
public static final int SYNTAX_FIELD_NUMBER- See Also:
-
syntax_
private int syntax_ -
EDITION_FIELD_NUMBER
public static final int EDITION_FIELD_NUMBER- See Also:
-
edition_
-
memoizedIsInitialized
private byte memoizedIsInitialized -
DEFAULT_INSTANCE
-
PARSER
-
-
Constructor Details
-
Type
-
Type
private Type()
-
-
Method Details
-
getDescriptor
-
getDescriptorForType
Description copied from interface:MessageOrBuilderGet the message's type's descriptor. This differs from thegetDescriptor()method of generated message classes in that this method is an abstract method of theMessageinterface whereasgetDescriptor()is a static method of a specific class. They return the same thing.- Specified by:
getDescriptorForTypein interfaceMessageOrBuilder- Overrides:
getDescriptorForTypein classGeneratedMessage
-
internalGetFieldAccessorTable
Description copied from class:GeneratedMessageGet the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.- Specified by:
internalGetFieldAccessorTablein classGeneratedMessage
-
getName
The fully qualified message name.
string name = 1;- Specified by:
getNamein interfaceTypeOrBuilder- Returns:
- The name.
-
getNameBytes
The fully qualified message name.
string name = 1;- Specified by:
getNameBytesin interfaceTypeOrBuilder- Returns:
- The bytes for name.
-
getFieldsList
The list of fields.
repeated .google.protobuf.Field fields = 2;- Specified by:
getFieldsListin interfaceTypeOrBuilder
-
getFieldsOrBuilderList
The list of fields.
repeated .google.protobuf.Field fields = 2;- Specified by:
getFieldsOrBuilderListin interfaceTypeOrBuilder
-
getFieldsCount
public int getFieldsCount()The list of fields.
repeated .google.protobuf.Field fields = 2;- Specified by:
getFieldsCountin interfaceTypeOrBuilder
-
getFields
The list of fields.
repeated .google.protobuf.Field fields = 2;- Specified by:
getFieldsin interfaceTypeOrBuilder
-
getFieldsOrBuilder
The list of fields.
repeated .google.protobuf.Field fields = 2;- Specified by:
getFieldsOrBuilderin interfaceTypeOrBuilder
-
getOneofsList
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;- Specified by:
getOneofsListin 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:
getOneofsCountin interfaceTypeOrBuilder- Returns:
- The count of oneofs.
-
getOneofs
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;- Specified by:
getOneofsin interfaceTypeOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The oneofs at the given index.
-
getOneofsBytes
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;- Specified by:
getOneofsBytesin interfaceTypeOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the oneofs at the given index.
-
getOptionsList
The protocol buffer options.
repeated .google.protobuf.Option options = 4;- Specified by:
getOptionsListin interfaceTypeOrBuilder
-
getOptionsOrBuilderList
The protocol buffer options.
repeated .google.protobuf.Option options = 4;- Specified by:
getOptionsOrBuilderListin interfaceTypeOrBuilder
-
getOptionsCount
public int getOptionsCount()The protocol buffer options.
repeated .google.protobuf.Option options = 4;- Specified by:
getOptionsCountin interfaceTypeOrBuilder
-
getOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 4;- Specified by:
getOptionsin interfaceTypeOrBuilder
-
getOptionsOrBuilder
The protocol buffer options.
repeated .google.protobuf.Option options = 4;- Specified by:
getOptionsOrBuilderin interfaceTypeOrBuilder
-
hasSourceContext
public boolean hasSourceContext()The source context.
.google.protobuf.SourceContext source_context = 5;- Specified by:
hasSourceContextin interfaceTypeOrBuilder- Returns:
- Whether the sourceContext field is set.
-
getSourceContext
The source context.
.google.protobuf.SourceContext source_context = 5;- Specified by:
getSourceContextin interfaceTypeOrBuilder- Returns:
- The sourceContext.
-
getSourceContextOrBuilder
The source context.
.google.protobuf.SourceContext source_context = 5;- Specified by:
getSourceContextOrBuilderin interfaceTypeOrBuilder
-
getSyntaxValue
public int getSyntaxValue()The source syntax.
.google.protobuf.Syntax syntax = 6;- Specified by:
getSyntaxValuein interfaceTypeOrBuilder- Returns:
- The enum numeric value on the wire for syntax.
-
getSyntax
The source syntax.
.google.protobuf.Syntax syntax = 6;- Specified by:
getSyntaxin interfaceTypeOrBuilder- Returns:
- The syntax.
-
getEdition
The source edition string, only valid when syntax is SYNTAX_EDITIONS.
string edition = 7;- Specified by:
getEditionin interfaceTypeOrBuilder- Returns:
- The edition.
-
getEditionBytes
The source edition string, only valid when syntax is SYNTAX_EDITIONS.
string edition = 7;- Specified by:
getEditionBytesin interfaceTypeOrBuilder- Returns:
- The bytes for edition.
-
isInitialized
public final boolean isInitialized()Description copied from interface:MessageLiteOrBuilderReturns true if all required fields in the message and all embedded messages are set, false otherwise.- Specified by:
isInitializedin interfaceMessageLiteOrBuilder- Overrides:
isInitializedin classGeneratedMessage
-
writeTo
Description copied from interface:MessageLiteSerializes the message and writes it tooutput. This does not flush or close the stream.- Specified by:
writeToin interfaceMessageLite- Overrides:
writeToin classGeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()Description copied from interface:MessageLiteGet the number of bytes required to encode this message. The result is only computed on the first call and memoized after that. If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will be smaller than the actual number of bytes required and might be negative.- Specified by:
getSerializedSizein interfaceMessageLite- Overrides:
getSerializedSizein classGeneratedMessage
-
equals
Description copied from interface:MessageCompares the specified object with this message for equality. Returnstrueif the given object is a message of the same type (as defined bygetDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheritingObject.equals()is incorrect.- Specified by:
equalsin interfaceMessage- Overrides:
equalsin classAbstractMessage- Parameters:
obj- object to be compared for equality with this message- Returns:
trueif the specified object is equal to this message
-
hashCode
public int hashCode()Description copied from interface:MessageReturns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheritingObject.hashCode()is incorrect.- Specified by:
hashCodein interfaceMessage- Overrides:
hashCodein classAbstractMessage- Returns:
- the hash code value for this message
- See Also:
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Type parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException - Throws:
InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Type parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Type parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Type parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
Description copied from interface:MessageLiteConstructs a new builder for a message of the same type as this message.- Specified by:
newBuilderForTypein interfaceMessage- Specified by:
newBuilderForTypein interfaceMessageLite
-
newBuilder
-
newBuilder
-
toBuilder
Description copied from interface:MessageLiteConstructs a builder initialized with the current message. Use this to derive a new message from the current one.- Specified by:
toBuilderin interfaceMessage- Specified by:
toBuilderin interfaceMessageLite
-
newBuilderForType
Description copied from class:AbstractMessageCreate a nested builder.- Overrides:
newBuilderForTypein classAbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
Description copied from class:GeneratedMessageTODO: Remove this unnecessary intermediate implementation of this method.- Specified by:
getParserForTypein interfaceMessage- Specified by:
getParserForTypein interfaceMessageLite- Overrides:
getParserForTypein classGeneratedMessage
-
getDefaultInstanceForType
Description copied from interface:MessageLiteOrBuilderGet an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from thegetDefaultInstance()method of generated message classes in that this method is an abstract method of theMessageLiteinterface whereasgetDefaultInstance()is a static method of a specific class. They return the same thing.- Specified by:
getDefaultInstanceForTypein interfaceMessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceMessageOrBuilder
-