Class GeneratedMessageLite<MessageType,BuilderType> (3.19.4)

public abstract class GeneratedMessageLite<MessageType,BuilderType> extends AbstractMessageLite<MessageType,BuilderType>

Lite version of GeneratedMessage.

Inheritance

Object > AbstractMessageLite > GeneratedMessageLite<MessageType,BuilderType>

Type Parameters

Name Description
MessageType
BuilderType

Static Methods

<ContainingType,Type>newRepeatedGeneratedExtension(ContainingType containingTypeDefaultInstance, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, boolean isPacked, Class singularType)

public static GeneratedMessageLite.GeneratedExtension<ContainingType,Type> <ContainingType,Type>newRepeatedGeneratedExtension(ContainingType containingTypeDefaultInstance, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, boolean isPacked, Class singularType)

For use by generated code only.

Parameters
Name Description
containingTypeDefaultInstance ContainingType
messageDefaultInstance MessageLite
enumTypeMap EnumLiteMap<?>
number int
type WireFormat.FieldType
isPacked boolean
singularType Class
Returns
Type Description
GeneratedExtension<ContainingType,Type>

<ContainingType,Type>newSingularGeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, Class singularType)

public static GeneratedMessageLite.GeneratedExtension<ContainingType,Type> <ContainingType,Type>newSingularGeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, Internal.EnumLiteMap<?> enumTypeMap, int number, WireFormat.FieldType type, Class singularType)

For use by generated code only.

Parameters
Name Description
containingTypeDefaultInstance ContainingType
defaultValue Type
messageDefaultInstance MessageLite
enumTypeMap EnumLiteMap<?>
number int
type WireFormat.FieldType
singularType Class
Returns
Type Description
GeneratedExtension<ContainingType,Type>

<E>emptyProtobufList()

protected static Internal.ProtobufList<E> <E>emptyProtobufList()
Returns
Type Description
ProtobufList<E>

<E>mutableCopy(Internal.ProtobufList<E> list)

protected static Internal.ProtobufList<E> <E>mutableCopy(Internal.ProtobufList<E> list)
Parameter
Name Description
list ProtobufList<E>
Returns
Type Description
ProtobufList<E>

<T>isInitialized(T message, boolean shouldMemoize)

protected static final boolean <T>isInitialized(T message, boolean shouldMemoize)

A static helper method for checking if a message is initialized, optionally memoizing.

For use by generated code only.

Parameters
Name Description
message T
shouldMemoize boolean
Returns
Type Description
boolean

<T>parseDelimitedFrom(T defaultInstance, InputStream input)

protected static T <T>parseDelimitedFrom(T defaultInstance, InputStream input)
Parameters
Name Description
defaultInstance T
input InputStream
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseDelimitedFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseDelimitedFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, byte[] data)

protected static T <T>parseFrom(T defaultInstance, byte[] data)
Parameters
Name Description
defaultInstance T
data byte[]
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteString data)

protected static T <T>parseFrom(T defaultInstance, ByteString data)
Parameters
Name Description
defaultInstance T
data ByteString
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, CodedInputStream input)

protected static T <T>parseFrom(T defaultInstance, CodedInputStream input)
Parameters
Name Description
defaultInstance T
input CodedInputStream
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, InputStream input)

protected static T <T>parseFrom(T defaultInstance, InputStream input)
Parameters
Name Description
defaultInstance T
input InputStream
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteBuffer data)

protected static T <T>parseFrom(T defaultInstance, ByteBuffer data)
Parameters
Name Description
defaultInstance T
data ByteBuffer
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteBuffer data, ExtensionRegistryLite extensionRegistry)

protected static T <T>parseFrom(T defaultInstance, ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
defaultInstance T
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>parsePartialFrom(T defaultInstance, CodedInputStream input)

protected static T <T>parsePartialFrom(T defaultInstance, CodedInputStream input)
Parameters
Name Description
defaultInstance T
input CodedInputStream
Returns
Type Description
T
Exceptions
Type Description
InvalidProtocolBufferException

<T>registerDefaultInstance(Class<T> clazz, T defaultInstance)

protected static void <T>registerDefaultInstance(Class<T> clazz, T defaultInstance)
Parameters
Name Description
clazz Class<T>
defaultInstance T

emptyBooleanList()

protected static Internal.BooleanList emptyBooleanList()
Returns
Type Description
Internal.BooleanList

emptyDoubleList()

protected static Internal.DoubleList emptyDoubleList()
Returns
Type Description
Internal.DoubleList

emptyFloatList()

protected static Internal.FloatList emptyFloatList()
Returns
Type Description
Internal.FloatList

emptyIntList()

protected static Internal.IntList emptyIntList()
Returns
Type Description
Internal.IntList

emptyLongList()

protected static Internal.LongList emptyLongList()
Returns
Type Description
Internal.LongList

mutableCopy(Internal.BooleanList list)

protected static Internal.BooleanList mutableCopy(Internal.BooleanList list)
Parameter
Name Description
list Internal.BooleanList
Returns
Type Description
Internal.BooleanList

mutableCopy(Internal.DoubleList list)

protected static Internal.DoubleList mutableCopy(Internal.DoubleList list)
Parameter
Name Description
list Internal.DoubleList
Returns
Type Description
Internal.DoubleList

mutableCopy(Internal.FloatList list)

protected static Internal.FloatList mutableCopy(Internal.FloatList list)
Parameter
Name Description
list Internal.FloatList
Returns
Type Description
Internal.FloatList

mutableCopy(Internal.IntList list)

protected static Internal.IntList mutableCopy(Internal.IntList list)
Parameter
Name Description
list Internal.IntList
Returns
Type Description
Internal.IntList

mutableCopy(Internal.LongList list)

protected static Internal.LongList mutableCopy(Internal.LongList list)
Parameter
Name Description
list Internal.LongList
Returns
Type Description
Internal.LongList

newMessageInfo(MessageLite defaultInstance, String info, Object[] objects)

protected static Object newMessageInfo(MessageLite defaultInstance, String info, Object[] objects)
Parameters
Name Description
defaultInstance MessageLite
info String
objects Object[]
Returns
Type Description
Object

Constructors

GeneratedMessageLite()

public GeneratedMessageLite()

Fields

memoizedSerializedSize

protected int memoizedSerializedSize

For use by generated code only.

Field Value
Type Description
int

unknownFields

protected UnknownFieldSetLite unknownFields

For use by generated code only. Lazily initialized to reduce allocations.

Field Value
Type Description
UnknownFieldSetLite

Methods

<MessageType,BuilderType>createBuilder()

protected final BuilderType <MessageType,BuilderType>createBuilder()
Returns
Type Description
BuilderType

<MessageType,BuilderType>createBuilder(MessageType prototype)

protected final BuilderType <MessageType,BuilderType>createBuilder(MessageType prototype)
Parameter
Name Description
prototype MessageType
Returns
Type Description
BuilderType

dynamicMethod(GeneratedMessageLite.MethodToInvoke method)

protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
Parameter
Name Description
method GeneratedMessageLite.MethodToInvoke
Returns
Type Description
Object

dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0)

protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0)
Parameters
Name Description
method GeneratedMessageLite.MethodToInvoke
arg0 Object
Returns
Type Description
Object

dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)

protected abstract Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)

A method that implements different types of operations described in 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. 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 isInitialized 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.

This method, plus the implementation of the Builder, enables the Builder class to be proguarded away entirely on Android.

For use by generated code only.

Parameters
Name Description
method GeneratedMessageLite.MethodToInvoke
arg0 Object
arg1 Object
Returns
Type Description
Object

equals(Object other)

public boolean equals(Object other)
Parameter
Name Description
other Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public final MessageType getDefaultInstanceForType()
Returns
Type Description
MessageType

getParserForType()

public final Parser<MessageType> getParserForType()
Returns
Type Description
Parser<MessageType>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean

makeImmutable()

protected void makeImmutable()

Called by subclasses to complete parsing. For use by generated code only.

mergeLengthDelimitedField(int fieldNumber, ByteString value)

protected void mergeLengthDelimitedField(int fieldNumber, ByteString value)

Called by subclasses to parse an unknown field. For use by generated code only.

Parameters
Name Description
fieldNumber int
value ByteString

mergeUnknownFields(UnknownFieldSetLite unknownFields)

protected final void mergeUnknownFields(UnknownFieldSetLite unknownFields)

Merge some unknown fields into the UnknownFieldSetLite for this message.

For use by generated code only.

Parameter
Name Description
unknownFields UnknownFieldSetLite

mergeVarintField(int tag, int value)

protected void mergeVarintField(int tag, int value)

Called by subclasses to parse an unknown field. For use by generated code only.

Parameters
Name Description
tag int
value int

newBuilderForType()

public final BuilderType newBuilderForType()
Returns
Type Description
BuilderType

parseUnknownField(int tag, CodedInputStream input)

protected boolean parseUnknownField(int tag, CodedInputStream input)

Called by subclasses to parse an unknown field. For use by generated code only.

Parameters
Name Description
tag int
input CodedInputStream
Returns
Type Description
boolean

true unless the tag is an end-group tag.

Exceptions
Type Description
IOException

toBuilder()

public final BuilderType toBuilder()
Returns
Type Description
BuilderType

toString()

public String toString()

A reflective toString function. This is primarily intended as a developer aid, while keeping binary size down. The first line of the 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.

Returns
Type Description
String
Overrides

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Exceptions
Type Description
IOException