public abstract class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite<MessageType,BuilderType>
GeneratedMessage
.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 |
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 static <T extends GeneratedMessageLite<T,?>> |
makeImmutable(T message) |
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.
|
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.
|
BuilderType |
toBuilder()
Constructs a builder initialized with the current message.
|
String |
toString()
A reflective toString function.
|
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getSerializedSize, 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.
MERGE_FROM_STREAM
is parameterized with an CodedInputStream
and ExtensionRegistryLite
. It consumes the input stream, parsing the contents into the
returned protocol buffer. If parsing throws an InvalidProtocolBufferException
,
the implementation wraps it in a RuntimeException.
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.
VISIT
is parameterized with a Visitor
and a MessageType
and
recursively iterates through the fields side by side between this and the instance.
MAKE_IMMUTABLE
sets all internal fields to an immutable state.
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.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 final <T extends GeneratedMessageLite<T,?>> void makeImmutable(T message)
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–2017 Google. All rights reserved.