public abstract class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite implements java.io.Serializable
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 void |
doneParsing()
Called by subclasses to complete parsing.
|
protected java.lang.Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method)
Same as
dynamicMethod(MethodToInvoke, Object, Object) with null padding. |
protected java.lang.Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method,
java.lang.Object arg0)
Same as
dynamicMethod(MethodToInvoke, Object, Object) with null padding. |
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 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 LazyStringArrayList |
emptyLazyStringArrayList() |
protected static Internal.LongList |
emptyLongList() |
protected static <E> Internal.ProtobufList<E> |
emptyProtobufList() |
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.
|
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 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 |
newBooleanList() |
protected static Internal.BooleanList |
newBooleanList(java.util.List<java.lang.Boolean> toCopy) |
protected static Internal.BooleanList |
newBooleanListWithCapacity(int capacity) |
BuilderType |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected static Internal.DoubleList |
newDoubleList() |
protected static Internal.DoubleList |
newDoubleList(java.util.List<java.lang.Double> toCopy) |
protected static Internal.DoubleList |
newDoubleListWithCapacity(int capacity) |
protected static Internal.FloatList |
newFloatList() |
protected static Internal.FloatList |
newFloatList(java.util.List<java.lang.Float> toCopy) |
protected static Internal.FloatList |
newFloatListWithCapacity(int capacity) |
protected static Internal.IntList |
newIntList() |
protected static Internal.IntList |
newIntList(java.util.List<java.lang.Integer> toCopy) |
protected static Internal.IntList |
newIntListWithCapacity(int capacity) |
protected static Internal.LongList |
newLongList() |
protected static Internal.LongList |
newLongList(java.util.List<java.lang.Long> toCopy) |
protected static Internal.LongList |
newLongListWithCapacity(int capacity) |
protected static <E> Internal.ProtobufList<E> |
newProtobufList() |
protected static <E> Internal.ProtobufList<E> |
newProtobufList(java.util.List<E> toCopy) |
protected static <E> Internal.ProtobufList<E> |
newProtobufListWithCapacity(int capacity) |
static <ContainingType extends MessageLite,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> |
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 boolean |
parseUnknownField(int tag,
CodedInputStream input)
Called by subclasses to parse an unknown field.
|
BuilderType |
toBuilder()
Constructs a builder initialized with the current message.
|
protected java.lang.Object |
writeReplace()
Replaces this object in the output stream with a serialized form.
|
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSerializedSize, writeTo
protected UnknownFieldSetLite unknownFields
protected int memoizedSerializedSize
public final Parser<MessageType> getParserForType()
MessageLite
getParserForType
in interface 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.getDefaultInstanceForType
in interface MessageLiteOrBuilder
public final BuilderType newBuilderForType()
MessageLite
newBuilderForType
in interface MessageLite
protected boolean parseUnknownField(int tag, CodedInputStream input) throws java.io.IOException
true
unless the tag is an end-group tag.java.io.IOException
protected void mergeVarintField(int tag, int value)
protected void mergeLengthDelimitedField(int fieldNumber, ByteString value)
protected void doneParsing()
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
public final BuilderType toBuilder()
MessageLite
toBuilder
in interface MessageLite
protected abstract java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.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.
PARSE_PARTIAL_FROM
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
IS_INITIALIZED
is parameterized with a Boolean
detailing whether to
memoize. It returns null
for false and the default instance for true. We optionally
memoize to support the Builder case, where memoization is not desired.
NEW_BUILDER
returns a BuilderType
instance.
MERGE_FROM
is parameterized with a MessageType
and merges the fields from
that instance into this instance.
MAKE_IMMUTABLE
sets all internal fields to an immutable state.
For use by generated code only.
protected java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0)
dynamicMethod(MethodToInvoke, Object, Object)
with null
padding.protected java.lang.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, java.lang.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, java.lang.Class singularType)
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
return super.writeReplace();
java.io.ObjectStreamException
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 newIntList()
protected static Internal.IntList newIntListWithCapacity(int capacity)
protected static Internal.IntList newIntList(java.util.List<java.lang.Integer> toCopy)
protected static Internal.IntList emptyIntList()
protected static Internal.LongList newLongList()
protected static Internal.LongList newLongListWithCapacity(int capacity)
protected static Internal.LongList newLongList(java.util.List<java.lang.Long> toCopy)
protected static Internal.LongList emptyLongList()
protected static Internal.FloatList newFloatList()
protected static Internal.FloatList newFloatListWithCapacity(int capacity)
protected static Internal.FloatList newFloatList(java.util.List<java.lang.Float> toCopy)
protected static Internal.FloatList emptyFloatList()
protected static Internal.DoubleList newDoubleList()
protected static Internal.DoubleList newDoubleListWithCapacity(int capacity)
protected static Internal.DoubleList newDoubleList(java.util.List<java.lang.Double> toCopy)
protected static Internal.DoubleList emptyDoubleList()
protected static Internal.BooleanList newBooleanList()
protected static Internal.BooleanList newBooleanListWithCapacity(int capacity)
protected static Internal.BooleanList newBooleanList(java.util.List<java.lang.Boolean> toCopy)
protected static Internal.BooleanList emptyBooleanList()
protected static <E> Internal.ProtobufList<E> newProtobufList()
protected static <E> Internal.ProtobufList<E> newProtobufList(java.util.List<E> toCopy)
protected static <E> Internal.ProtobufList<E> newProtobufListWithCapacity(int capacity)
protected static <E> Internal.ProtobufList<E> emptyProtobufList()
protected static LazyStringArrayList emptyLazyStringArrayList()