public abstract class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite implements 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 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 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 |
mergeUnknownFields(UnknownFieldSetLite unknownFields)
Merge some unknown fields into the
UnknownFieldSetLite for this
message. |
protected static Internal.BooleanList |
newBooleanList() |
protected static Internal.BooleanList |
newBooleanList(List<Boolean> toCopy) |
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(List<Double> toCopy) |
protected static Internal.FloatList |
newFloatList() |
protected static Internal.FloatList |
newFloatList(List<Float> toCopy) |
protected static Internal.IntList |
newIntList() |
protected static Internal.IntList |
newIntList(List<Integer> toCopy) |
protected static Internal.LongList |
newLongList() |
protected static Internal.LongList |
newLongList(List<Long> toCopy) |
protected static <E> Internal.ProtobufList<E> |
newProtobufList() |
protected static <E> Internal.ProtobufList<E> |
newProtobufList(List<E> toCopy) |
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 boolean |
parseUnknownField(CodedInputStream input,
UnknownFieldSetLite.Builder unknownFields,
ExtensionRegistryLite extensionRegistry,
int tag)
Called by subclasses to parse an unknown field.
|
protected static <MessageType extends MessageLite> |
parseUnknownField(com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> extensions,
MessageType defaultInstance,
CodedInputStream input,
UnknownFieldSetLite.Builder unknownFields,
ExtensionRegistryLite extensionRegistry,
int tag)
Parse an unknown field or an extension.
|
BuilderType |
toBuilder()
Constructs a builder initialized with the current message.
|
protected Object |
writeReplace()
Replaces this object in the output stream with a serialized form.
|
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSerializedSize, writeToprotected UnknownFieldSetLite unknownFields
protected int memoizedSerializedSize
public final Parser<MessageType> getParserForType()
MessageLitegetParserForType in interface MessageLitepublic final MessageType getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() 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 MessageLiteOrBuilderpublic final BuilderType newBuilderForType()
MessageLitenewBuilderForType in interface MessageLiteprotected static boolean parseUnknownField(CodedInputStream input, UnknownFieldSetLite.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag) throws IOException
true unless the tag is an end-group tag.IOExceptionpublic final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderpublic final BuilderType toBuilder()
MessageLitetoBuilder in interface MessageLiteprotected 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.
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 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.
protected static <MessageType extends MessageLite> boolean parseUnknownField(com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> extensions, MessageType defaultInstance, CodedInputStream input, UnknownFieldSetLite.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag) throws IOException
true unless the tag is an end-group tag.IOExceptionpublic 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 Object writeReplace() throws ObjectStreamException
return super.writeReplace();ObjectStreamExceptionprotected 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 newIntList(List<Integer> toCopy)
protected static Internal.IntList emptyIntList()
protected static Internal.LongList newLongList()
protected static Internal.LongList newLongList(List<Long> toCopy)
protected static Internal.LongList emptyLongList()
protected static Internal.FloatList newFloatList()
protected static Internal.FloatList newFloatList(List<Float> toCopy)
protected static Internal.FloatList emptyFloatList()
protected static Internal.DoubleList newDoubleList()
protected static Internal.DoubleList newDoubleList(List<Double> toCopy)
protected static Internal.DoubleList emptyDoubleList()
protected static Internal.BooleanList newBooleanList()
protected static Internal.BooleanList newBooleanList(List<Boolean> toCopy)
protected static Internal.BooleanList emptyBooleanList()
protected static <E> Internal.ProtobufList<E> newProtobufList()
protected static <E> Internal.ProtobufList<E> newProtobufList(List<E> toCopy)
protected static <E> Internal.ProtobufList<E> emptyProtobufList()
protected static LazyStringArrayList emptyLazyStringArrayList()
Copyright © 2008–2015 Google. All rights reserved.