Package com.google.protobuf
Class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
-
- com.google.protobuf.GeneratedMessageLite<MessageType,BuilderType>
-
- All Implemented Interfaces:
MessageLite,MessageLiteOrBuilder
- Direct Known Subclasses:
GeneratedMessageLite.ExtendableMessage
public abstract class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite<MessageType,BuilderType>
Lite version ofGeneratedMessage.
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected intmemoizedSerializedSizeFor use by generated code only.protected UnknownFieldSetLiteunknownFieldsFor use by generated code only.-
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
-
Constructor Summary
Constructors Constructor Description GeneratedMessageLite()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BuilderTypecreateBuilder()protected BuilderTypecreateBuilder(MessageType prototype)protected java.lang.ObjectdynamicMethod(GeneratedMessageLite.MethodToInvoke method)Same asdynamicMethod(MethodToInvoke, Object, Object)withnullpadding.protected java.lang.ObjectdynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0)Same asdynamicMethod(MethodToInvoke, Object, Object)withnullpadding.protected abstract java.lang.ObjectdynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.Object arg1)A method that implements different types of operations described inGeneratedMessageLite.MethodToInvoke.protected static Internal.BooleanListemptyBooleanList()protected static Internal.DoubleListemptyDoubleList()protected static Internal.FloatListemptyFloatList()protected static Internal.IntListemptyIntList()protected static Internal.LongListemptyLongList()protected static <E> Internal.ProtobufList<E>emptyProtobufList()booleanequals(java.lang.Object other)MessageTypegetDefaultInstanceForType()Get an instance of the type with no fields set.Parser<MessageType>getParserForType()Gets the parser for a message of the same type as this message.inthashCode()booleanisInitialized()Returns true if all required fields in the message and all embedded messages are set, false otherwise.protected static <T extends GeneratedMessageLite<T,?>>
booleanisInitialized(T message, boolean shouldMemoize)A static helper method for checking if a message is initialized, optionally memoizing.protected voidmakeImmutable()Called by subclasses to complete parsing.protected voidmergeLengthDelimitedField(int fieldNumber, ByteString value)Called by subclasses to parse an unknown field.protected voidmergeUnknownFields(UnknownFieldSetLite unknownFields)Merge some unknown fields into theUnknownFieldSetLitefor this message.protected voidmergeVarintField(int tag, int value)Called by subclasses to parse an unknown field.protected static Internal.BooleanListmutableCopy(Internal.BooleanList list)protected static Internal.DoubleListmutableCopy(Internal.DoubleList list)protected static Internal.FloatListmutableCopy(Internal.FloatList list)protected static Internal.IntListmutableCopy(Internal.IntList list)protected static Internal.LongListmutableCopy(Internal.LongList list)protected static <E> Internal.ProtobufList<E>mutableCopy(Internal.ProtobufList<E> list)BuilderTypenewBuilderForType()Constructs a new builder for a message of the same type as this message.static <ContainingType extends MessageLite,Type>
GeneratedMessageLite.GeneratedExtension<ContainingType,Type>newRepeatedGeneratedExtension(ContainingType containingTypeDefaultInstance, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, boolean isPacked, java.lang.Class singularType)For use by generated code only.static <ContainingType extends MessageLite,Type>
GeneratedMessageLite.GeneratedExtension<ContainingType,Type>newSingularGeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, java.lang.Class singularType)For use by generated code only.protected static <T extends GeneratedMessageLite<T,?>>
TparseDelimitedFrom(T defaultInstance, java.io.InputStream input)protected static <T extends GeneratedMessageLite<T,?>>
TparseDelimitedFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, byte[] data)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, ByteString data)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, CodedInputStream input)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, java.io.InputStream input)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, java.nio.ByteBuffer data)protected static <T extends GeneratedMessageLite<T,?>>
TparseFrom(T defaultInstance, java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry)protected static <T extends GeneratedMessageLite<T,?>>
TparsePartialFrom(T defaultInstance, CodedInputStream input)protected booleanparseUnknownField(int tag, CodedInputStream input)Called by subclasses to parse an unknown field.BuilderTypetoBuilder()Constructs a builder initialized with the current message.-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.protobuf.MessageLite
getSerializedSize, writeTo
-
-
-
-
Field Detail
-
unknownFields
protected UnknownFieldSetLite unknownFields
For use by generated code only. Lazily initialized to reduce allocations.
-
memoizedSerializedSize
protected int memoizedSerializedSize
For use by generated code only.
-
-
Method Detail
-
getParserForType
public final Parser<MessageType> getParserForType()
Description copied from interface:MessageLiteGets the parser for a message of the same type as this message.
-
getDefaultInstanceForType
public final MessageType 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.
-
newBuilderForType
public final BuilderType newBuilderForType()
Description copied from interface:MessageLiteConstructs a new builder for a message of the same type as this message.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
parseUnknownField
protected boolean parseUnknownField(int tag, CodedInputStream input) throws java.io.IOExceptionCalled by subclasses to parse an unknown field. For use by generated code only.- Returns:
trueunless the tag is an end-group tag.- Throws:
java.io.IOException
-
mergeVarintField
protected void mergeVarintField(int tag, int value)Called by subclasses to parse an unknown field. For use by generated code only.
-
mergeLengthDelimitedField
protected void mergeLengthDelimitedField(int fieldNumber, ByteString value)Called by subclasses to parse an unknown field. For use by generated code only.
-
makeImmutable
protected void makeImmutable()
Called by subclasses to complete parsing. For use by generated code only.
-
createBuilder
protected final BuilderType createBuilder()
-
createBuilder
protected final BuilderType createBuilder(MessageType prototype)
-
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.See also:
MessageOrBuilder#getInitializationErrorString()
-
toBuilder
public final BuilderType toBuilder()
Description copied from interface:MessageLiteConstructs a builder initialized with the current message. Use this to derive a new message from the current one.
-
dynamicMethod
protected abstract 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. Theses 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.MERGE_FROM_STREAMis parameterized with anCodedInputStreamandExtensionRegistryLite. It consumes the input stream, parsing the contents into the returned protocol buffer. If parsing throws anInvalidProtocolBufferException, the implementation wraps it in a RuntimeException.NEW_INSTANCEreturns a new instance of the protocol buffer that has not yet been made immutable. SeeMAKE_IMMUTABLE.IS_INITIALIZEDreturnsnullfor false and the default instance for true. It doesn't use or modify any memoized value.GET_MEMOIZED_IS_INITIALIZEDreturns the memoizedisInitializedbyte value.SET_MEMOIZED_IS_INITIALIZEDsets the memoizedisInitilaizedbyte value to 1 if the first parameter is not null, or to 0 if the first parameter is null.NEW_BUILDERreturns aBuilderTypeinstance.VISITis parameterized with aVisitorand aMessageTypeand recursively iterates through the fields side by side between this and the instance.MAKE_IMMUTABLEsets all internal fields to an immutable state.
For use by generated code only.
-
dynamicMethod
protected java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0)
Same asdynamicMethod(MethodToInvoke, Object, Object)withnullpadding.
-
dynamicMethod
protected java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
Same asdynamicMethod(MethodToInvoke, Object, Object)withnullpadding.
-
mergeUnknownFields
protected final void mergeUnknownFields(UnknownFieldSetLite unknownFields)
Merge some unknown fields into theUnknownFieldSetLitefor this message.For use by generated code only.
-
newSingularGeneratedExtension
public static <ContainingType extends MessageLite,Type> GeneratedMessageLite.GeneratedExtension<ContainingType,Type> newSingularGeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, java.lang.Class singularType)
For use by generated code only.
-
newRepeatedGeneratedExtension
public static <ContainingType extends MessageLite,Type> GeneratedMessageLite.GeneratedExtension<ContainingType,Type> newRepeatedGeneratedExtension(ContainingType containingTypeDefaultInstance, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, boolean isPacked, java.lang.Class singularType)
For use by generated code only.
-
isInitialized
protected static final <T extends GeneratedMessageLite<T,?>> boolean isInitialized(T message, boolean shouldMemoize)
A static helper method for checking if a message is initialized, optionally memoizing.For use by generated code only.
-
emptyIntList
protected static Internal.IntList emptyIntList()
-
mutableCopy
protected static Internal.IntList mutableCopy(Internal.IntList list)
-
emptyLongList
protected static Internal.LongList emptyLongList()
-
mutableCopy
protected static Internal.LongList mutableCopy(Internal.LongList list)
-
emptyFloatList
protected static Internal.FloatList emptyFloatList()
-
mutableCopy
protected static Internal.FloatList mutableCopy(Internal.FloatList list)
-
emptyDoubleList
protected static Internal.DoubleList emptyDoubleList()
-
mutableCopy
protected static Internal.DoubleList mutableCopy(Internal.DoubleList list)
-
emptyBooleanList
protected static Internal.BooleanList emptyBooleanList()
-
mutableCopy
protected static Internal.BooleanList mutableCopy(Internal.BooleanList list)
-
emptyProtobufList
protected static <E> Internal.ProtobufList<E> emptyProtobufList()
-
mutableCopy
protected static <E> Internal.ProtobufList<E> mutableCopy(Internal.ProtobufList<E> list)
-
parsePartialFrom
protected static <T extends GeneratedMessageLite<T,?>> T parsePartialFrom(T defaultInstance, CodedInputStream input) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, java.nio.ByteBuffer data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteString data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, byte[] data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, java.io.InputStream input) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, CodedInputStream input) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseDelimitedFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance, java.io.InputStream input) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseDelimitedFrom
protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
-