public abstract class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite<MessageType,BuilderType>
GeneratedMessage
.AbstractMessageLite.InternalOneOfEnum
Modifier and Type | Field and Description |
---|---|
protected int |
memoizedSerializedSize
For use by generated code only.
|
protected UnknownFieldSetLite |
unknownFields
For use by generated code only.
|
memoizedHashCode
Constructor and Description |
---|
GeneratedMessageLite() |
Modifier and Type | Method and Description |
---|---|
protected <MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> |
createBuilder() |
protected <MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> |
createBuilder(MessageType prototype) |
protected Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
Same as
dynamicMethod(MethodToInvoke, Object, Object) with null padding. |
protected Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method,
Object arg0)
Same as
dynamicMethod(MethodToInvoke, Object, Object) with null padding. |
protected abstract Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method,
Object arg0,
Object arg1)
A method that implements different types of operations described in
GeneratedMessageLite.MethodToInvoke . |
protected static Internal.BooleanList |
emptyBooleanList() |
protected static Internal.DoubleList |
emptyDoubleList() |
protected static Internal.FloatList |
emptyFloatList() |
protected static Internal.IntList |
emptyIntList() |
protected static Internal.LongList |
emptyLongList() |
protected static <E> Internal.ProtobufList<E> |
emptyProtobufList() |
boolean |
equals(Object other) |
MessageType |
getDefaultInstanceForType()
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.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
int |
hashCode() |
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false
otherwise.
|
protected static <T extends GeneratedMessageLite<T,?>> |
isInitialized(T message,
boolean shouldMemoize)
A static helper method for checking if a message is initialized, optionally memoizing.
|
protected void |
makeImmutable()
Called by subclasses to complete parsing.
|
protected void |
mergeLengthDelimitedField(int fieldNumber,
ByteString value)
Called by subclasses to parse an unknown field.
|
protected void |
mergeUnknownFields(UnknownFieldSetLite unknownFields)
Merge some unknown fields into the
UnknownFieldSetLite for this message. |
protected void |
mergeVarintField(int tag,
int value)
Called by subclasses to parse an unknown field.
|
protected static Internal.BooleanList |
mutableCopy(Internal.BooleanList list) |
protected static Internal.DoubleList |
mutableCopy(Internal.DoubleList list) |
protected static Internal.FloatList |
mutableCopy(Internal.FloatList list) |
protected static Internal.IntList |
mutableCopy(Internal.IntList list) |
protected static Internal.LongList |
mutableCopy(Internal.LongList list) |
protected static <E> Internal.ProtobufList<E> |
mutableCopy(Internal.ProtobufList<E> list) |
BuilderType |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected static Object |
newMessageInfo(MessageLite defaultInstance,
String info,
Object[] objects) |
static <ContainingType extends MessageLite,Type> |
newRepeatedGeneratedExtension(ContainingType containingTypeDefaultInstance,
MessageLite messageDefaultInstance,
Internal.EnumLiteMap<?> enumTypeMap,
int number,
WireFormat.FieldType type,
boolean isPacked,
Class singularType)
For use by generated code only.
|
static <ContainingType extends MessageLite,Type> |
newSingularGeneratedExtension(ContainingType containingTypeDefaultInstance,
Type defaultValue,
MessageLite messageDefaultInstance,
Internal.EnumLiteMap<?> enumTypeMap,
int number,
WireFormat.FieldType type,
Class singularType)
For use by generated code only.
|
protected static <T extends GeneratedMessageLite<T,?>> |
parseDelimitedFrom(T defaultInstance,
InputStream input) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseDelimitedFrom(T defaultInstance,
InputStream input,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
byte[] data) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
byte[] data,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
ByteBuffer data) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
ByteString data) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
ByteString data,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
CodedInputStream input) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
InputStream input) |
protected static <T extends GeneratedMessageLite<T,?>> |
parseFrom(T defaultInstance,
InputStream input,
ExtensionRegistryLite extensionRegistry) |
protected static <T extends GeneratedMessageLite<T,?>> |
parsePartialFrom(T defaultInstance,
CodedInputStream input) |
protected boolean |
parseUnknownField(int tag,
CodedInputStream input)
Called by subclasses to parse an unknown field.
|
protected static <T extends GeneratedMessageLite<?,?>> |
registerDefaultInstance(Class<T> clazz,
T defaultInstance) |
BuilderType |
toBuilder()
Constructs a builder initialized with the current message.
|
String |
toString()
A reflective toString function.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output . |
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
protected UnknownFieldSetLite unknownFields
protected int memoizedSerializedSize
public final Parser<MessageType> getParserForType()
MessageLite
public final MessageType 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.public final BuilderType newBuilderForType()
MessageLite
public String toString()
toString()
representation includes a commented
version of super.toString()
to act as an indicator that this should not be relied on
for comparisons.
NOTE: This method relies on the field getter methods not being stripped or renamed by proguard. If they are, the fields will not be included in the returned string representation.
NOTE: This implementation is liable to change in the future, and should not be relied on in code.
protected boolean parseUnknownField(int tag, CodedInputStream input) throws IOException
true
unless the tag is an end-group tag.IOException
protected void mergeVarintField(int tag, int value)
protected void mergeLengthDelimitedField(int fieldNumber, ByteString value)
protected void makeImmutable()
protected final <MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> BuilderType createBuilder()
protected final <MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> BuilderType createBuilder(MessageType prototype)
public final boolean isInitialized()
MessageLiteOrBuilder
public final BuilderType toBuilder()
MessageLite
protected abstract Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
GeneratedMessageLite.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.
NEW_INSTANCE
returns a new instance of the protocol buffer that has not yet been
made immutable. See MAKE_IMMUTABLE
.
IS_INITIALIZED
returns null
for false and the default instance for true.
It doesn't use or modify any memoized value.
GET_MEMOIZED_IS_INITIALIZED
returns the memoized isInitialized
byte
value.
SET_MEMOIZED_IS_INITIALIZED
sets the memoized isInitilaized
byte value to
1 if the first parameter is not null, or to 0 if the first parameter is null.
NEW_BUILDER
returns a BuilderType
instance.
For use by generated code only.
protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0)
dynamicMethod(MethodToInvoke, Object, Object)
with null
padding.protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
dynamicMethod(MethodToInvoke, Object, Object)
with null
padding.public void writeTo(CodedOutputStream output) throws IOException
MessageLite
output
. This does not flush or close the
stream.IOException
public int getSerializedSize()
MessageLite
protected static <T extends GeneratedMessageLite<?,?>> void registerDefaultInstance(Class<T> clazz, T defaultInstance)
protected static Object newMessageInfo(MessageLite defaultInstance, String info, Object[] objects)
protected final void mergeUnknownFields(UnknownFieldSetLite unknownFields)
UnknownFieldSetLite
for this message.
For use by generated code only.
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, Class singularType)
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, Class singularType)
protected static final <T extends GeneratedMessageLite<T,?>> boolean isInitialized(T message, boolean shouldMemoize)
For use by generated code only.
protected static Internal.IntList emptyIntList()
protected static Internal.IntList mutableCopy(Internal.IntList list)
protected static Internal.LongList emptyLongList()
protected static Internal.LongList mutableCopy(Internal.LongList list)
protected static Internal.FloatList emptyFloatList()
protected static Internal.FloatList mutableCopy(Internal.FloatList list)
protected static Internal.DoubleList emptyDoubleList()
protected static Internal.DoubleList mutableCopy(Internal.DoubleList list)
protected static Internal.BooleanList emptyBooleanList()
protected static Internal.BooleanList mutableCopy(Internal.BooleanList list)
protected static <E> Internal.ProtobufList<E> emptyProtobufList()
protected static <E> Internal.ProtobufList<E> mutableCopy(Internal.ProtobufList<E> list)
protected static <T extends GeneratedMessageLite<T,?>> T parsePartialFrom(T defaultInstance, CodedInputStream input) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, InputStream input) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, CodedInputStream input) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance, InputStream input) throws InvalidProtocolBufferException
InvalidProtocolBufferException
protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
Copyright © 2008–2019. All rights reserved.