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

NameDescription
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
NameDescription
containingTypeDefaultInstanceContainingType
messageDefaultInstanceMessageLite
enumTypeMapEnumLiteMap<?>
numberint
typeWireFormat.FieldType
isPackedboolean
singularTypeClass
Returns
TypeDescription
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
NameDescription
containingTypeDefaultInstanceContainingType
defaultValueType
messageDefaultInstanceMessageLite
enumTypeMapEnumLiteMap<?>
numberint
typeWireFormat.FieldType
singularTypeClass
Returns
TypeDescription
GeneratedExtension<ContainingType,Type>

<E>emptyProtobufList()

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

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

protected static Internal.ProtobufList<E> <E>mutableCopy(Internal.ProtobufList<E> list)
Parameter
NameDescription
listProtobufList<E>
Returns
TypeDescription
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
NameDescription
messageT
shouldMemoizeboolean
Returns
TypeDescription
boolean

<T>parseDelimitedFrom(T defaultInstance, InputStream input)

protected static T <T>parseDelimitedFrom(T defaultInstance, InputStream input)
Parameters
NameDescription
defaultInstanceT
inputInputStream
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseDelimitedFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, byte[] data)
Parameters
NameDescription
defaultInstanceT
databyte[]
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteString data)

protected static T <T>parseFrom(T defaultInstance, ByteString data)
Parameters
NameDescription
defaultInstanceT
dataByteString
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, CodedInputStream input)

protected static T <T>parseFrom(T defaultInstance, CodedInputStream input)
Parameters
NameDescription
defaultInstanceT
inputCodedInputStream
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, InputStream input)

protected static T <T>parseFrom(T defaultInstance, InputStream input)
Parameters
NameDescription
defaultInstanceT
inputInputStream
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

<T>parseFrom(T defaultInstance, ByteBuffer data)

protected static T <T>parseFrom(T defaultInstance, ByteBuffer data)
Parameters
NameDescription
defaultInstanceT
dataByteBuffer
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static T <T>parseFrom(T defaultInstance, ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
defaultInstanceT
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

<T>parsePartialFrom(T defaultInstance, CodedInputStream input)

protected static T <T>parsePartialFrom(T defaultInstance, CodedInputStream input)
Parameters
NameDescription
defaultInstanceT
inputCodedInputStream
Returns
TypeDescription
T
Exceptions
TypeDescription
InvalidProtocolBufferException

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

protected static void <T>registerDefaultInstance(Class<T> clazz, T defaultInstance)
Parameters
NameDescription
clazzClass<T>
defaultInstanceT

emptyBooleanList()

protected static Internal.BooleanList emptyBooleanList()
Returns
TypeDescription
Internal.BooleanList

emptyDoubleList()

protected static Internal.DoubleList emptyDoubleList()
Returns
TypeDescription
Internal.DoubleList

emptyFloatList()

protected static Internal.FloatList emptyFloatList()
Returns
TypeDescription
Internal.FloatList

emptyIntList()

protected static Internal.IntList emptyIntList()
Returns
TypeDescription
Internal.IntList

emptyLongList()

protected static Internal.LongList emptyLongList()
Returns
TypeDescription
Internal.LongList

mutableCopy(Internal.BooleanList list)

protected static Internal.BooleanList mutableCopy(Internal.BooleanList list)
Parameter
NameDescription
listInternal.BooleanList
Returns
TypeDescription
Internal.BooleanList

mutableCopy(Internal.DoubleList list)

protected static Internal.DoubleList mutableCopy(Internal.DoubleList list)
Parameter
NameDescription
listInternal.DoubleList
Returns
TypeDescription
Internal.DoubleList

mutableCopy(Internal.FloatList list)

protected static Internal.FloatList mutableCopy(Internal.FloatList list)
Parameter
NameDescription
listInternal.FloatList
Returns
TypeDescription
Internal.FloatList

mutableCopy(Internal.IntList list)

protected static Internal.IntList mutableCopy(Internal.IntList list)
Parameter
NameDescription
listInternal.IntList
Returns
TypeDescription
Internal.IntList

mutableCopy(Internal.LongList list)

protected static Internal.LongList mutableCopy(Internal.LongList list)
Parameter
NameDescription
listInternal.LongList
Returns
TypeDescription
Internal.LongList

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

protected static Object newMessageInfo(MessageLite defaultInstance, String info, Object[] objects)
Parameters
NameDescription
defaultInstanceMessageLite
infoString
objectsObject[]
Returns
TypeDescription
Object

Constructors

GeneratedMessageLite()

public GeneratedMessageLite()

Fields

memoizedSerializedSize

protected int memoizedSerializedSize

For use by generated code only.

Field Value
TypeDescription
int

unknownFields

protected UnknownFieldSetLite unknownFields

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

Field Value
TypeDescription
UnknownFieldSetLite

Methods

<MessageType,BuilderType>createBuilder()

protected final BuilderType <MessageType,BuilderType>createBuilder()
Returns
TypeDescription
BuilderType

<MessageType,BuilderType>createBuilder(MessageType prototype)

protected final BuilderType <MessageType,BuilderType>createBuilder(MessageType prototype)
Parameter
NameDescription
prototypeMessageType
Returns
TypeDescription
BuilderType

dynamicMethod(GeneratedMessageLite.MethodToInvoke method)

protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
Parameter
NameDescription
methodGeneratedMessageLite.MethodToInvoke
Returns
TypeDescription
Object

dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0)

protected Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0)
Parameters
NameDescription
methodGeneratedMessageLite.MethodToInvoke
arg0Object
Returns
TypeDescription
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
NameDescription
methodGeneratedMessageLite.MethodToInvoke
arg0Object
arg1Object
Returns
TypeDescription
Object

equals(Object other)

public boolean equals(Object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public final MessageType getDefaultInstanceForType()
Returns
TypeDescription
MessageType

getParserForType()

public final Parser<MessageType> getParserForType()
Returns
TypeDescription
Parser<MessageType>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
fieldNumberint
valueByteString

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
NameDescription
unknownFieldsUnknownFieldSetLite

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
NameDescription
tagint
valueint

newBuilderForType()

public final BuilderType newBuilderForType()
Returns
TypeDescription
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
NameDescription
tagint
inputCodedInputStream
Returns
TypeDescription
boolean

true unless the tag is an end-group tag.

Exceptions
TypeDescription
IOException

toBuilder()

public final BuilderType toBuilder()
Returns
TypeDescription
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
TypeDescription
String
Overrides

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Exceptions
TypeDescription
IOException