com.google.protobuf

## Class GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>

- java.lang.Object
- - com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
  - - com.google.protobuf.GeneratedMessageLite<MessageType,BuilderType>

- All Implemented Interfaces:
    MessageLite, MessageLiteOrBuilder
  Direct Known Subclasses:
    GeneratedMessageLite.ExtendableMessage

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

  Lite version of `GeneratedMessage`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GeneratedMessageLite.Builder<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>`
    `protected static class` | `GeneratedMessageLite.DefaultInstanceBasedParser<T extends GeneratedMessageLite<T,?>>` A `Parser` implementation that delegates to the default instance.
    `static class` | `GeneratedMessageLite.ExtendableBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>` Lite equivalent of `GeneratedMessage.ExtendableBuilder`.
    `static class` | `GeneratedMessageLite.ExtendableMessage<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>` Lite equivalent of `GeneratedMessage.ExtendableMessage`.
    `static interface` | `GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>` Lite equivalent of `GeneratedMessage.ExtendableMessageOrBuilder`.
    `static class` | `GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>` Lite equivalent to `GeneratedMessage.GeneratedExtension`.
    `protected static class` | `GeneratedMessageLite.MergeFromVisitor` Implements field merging semantics over the visitor interface.
    `static class` | `GeneratedMessageLite.MethodToInvoke` Defines which method path to invoke in `#dynamicMethod(MethodToInvoke, Object...)`.
    `protected static class` | `GeneratedMessageLite.SerializedForm` A serialized (serializable) form of the generated message.
    `protected static interface` | `GeneratedMessageLite.Visitor` An abstract visitor that the generated code calls into that we use to implement various features.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `memoizedSerializedSize` For use by generated code only.
    `protected UnknownFieldSetLite` | `unknownFields` For use by generated code only.

    - ### Fields inherited from class com.google.protobuf.AbstractMessageLite

      `memoizedHashCode`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeneratedMessageLite()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 Internal.LongList` | `emptyLongList()`
    `protected static <E> Internal.ProtobufList<E>` | `emptyProtobufList()`
    `boolean` | `equals(java.lang.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,?>> boolean` | `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,?>> void` | `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> GeneratedMessageLite.GeneratedExtension<ContainingType,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> GeneratedMessageLite.GeneratedExtension<ContainingType,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 static <T extends GeneratedMessageLite<T,?>> T` | `parseDelimitedFrom(T defaultInstance, java.io.InputStream input)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseDelimitedFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, byte[] data)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, java.nio.ByteBuffer data)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, ByteString data)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, CodedInputStream input)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, java.io.InputStream input)`
    `protected static <T extends GeneratedMessageLite<T,?>> T` | `parseFrom(T defaultInstance, java.io.InputStream input, ExtensionRegistryLite extensionRegistry)`
    `protected static <T extends GeneratedMessageLite<T,?>> 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.
    `java.lang.String` | `toString()` A reflective toString function.

    - ### Methods inherited from class com.google.protobuf.AbstractMessageLite

      `addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.google.protobuf.MessageLite

      `getSerializedSize, writeTo`

- - ### Field Detail

    - #### unknownFields

          protected UnknownFieldSetLite unknownFields

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

    - #### memoizedSerializedSize

          protected int memoizedSerializedSize

      For use by generated code only.

  - ### Constructor Detail

    - #### GeneratedMessageLite

          public GeneratedMessageLite()

  - ### Method Detail

    - #### getParserForType

          public final Parser<MessageType> getParserForType()

      Description copied from interface: `MessageLite`
      Gets the parser for a message of the same type as this message.

    - #### getDefaultInstanceForType

          public final MessageType getDefaultInstanceForType()

      Description copied from interface: `MessageLiteOrBuilder`
      Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the `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.

    - #### newBuilderForType

          public final BuilderType newBuilderForType()

      Description copied from interface: `MessageLite`
      Constructs a new builder for a message of the same type as this message.

    - #### toString

          public java.lang.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.

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### parseUnknownField

          protected boolean parseUnknownField(int tag,
                                  CodedInputStream input)
                                       throws java.io.IOException

      Called by subclasses to parse an unknown field. For use by generated code only.
      Returns:
        `true` unless the tag is an end-group tag.
      Throws:
        `java.io.IOException`

    - #### mergeVarintField

          protected void mergeVarintField(int tag,
                              int value)

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

    - #### mergeLengthDelimitedField

          protected void mergeLengthDelimitedField(int fieldNumber,
                                       ByteString value)

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

    - #### makeImmutable

          protected void makeImmutable()

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

    - #### isInitialized

          public final boolean isInitialized()

      Description copied from interface: `MessageLiteOrBuilder`
      Returns true if all required fields in the message and all embedded messages are set, false otherwise.

      See also: `MessageOrBuilder.getInitializationErrorString()`

    - #### toBuilder

          public final BuilderType toBuilder()

      Description copied from interface: `MessageLite`
      Constructs a builder initialized with the current message. Use this to derive a new message from the current one.

    - #### dynamicMethod

          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`. 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` 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.
      - `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.
      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.

    - #### dynamicMethod

          protected java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method,
                                       java.lang.Object arg0)

      Same as `dynamicMethod(MethodToInvoke, Object, Object)` with `null` padding.

    - #### dynamicMethod

          protected java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method)

      Same as `dynamicMethod(MethodToInvoke, Object, Object)` with `null` padding.

    - #### mergeUnknownFields

          protected final void mergeUnknownFields(UnknownFieldSetLite unknownFields)

      Merge some unknown fields into the `UnknownFieldSetLite` for this message.

      For use by generated code only.

    - #### newSingularGeneratedExtension

          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)

      For use by generated code only.

    - #### newRepeatedGeneratedExtension

          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)

      For use by generated code only.

    - #### isInitialized

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

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

      For use by generated code only.

    - #### makeImmutable

          protected static final <T extends GeneratedMessageLite<T,?>> void makeImmutable(T message)

    - #### emptyIntList

          protected static Internal.IntList emptyIntList()

    - #### mutableCopy

          protected static Internal.IntList mutableCopy(Internal.IntList list)

    - #### emptyLongList

          protected static Internal.LongList emptyLongList()

    - #### mutableCopy

          protected static Internal.LongList mutableCopy(Internal.LongList list)

    - #### emptyFloatList

          protected static Internal.FloatList emptyFloatList()

    - #### mutableCopy

          protected static Internal.FloatList mutableCopy(Internal.FloatList list)

    - #### emptyDoubleList

          protected static Internal.DoubleList emptyDoubleList()

    - #### mutableCopy

          protected static Internal.DoubleList mutableCopy(Internal.DoubleList list)

    - #### emptyBooleanList

          protected static Internal.BooleanList emptyBooleanList()

    - #### mutableCopy

          protected static Internal.BooleanList mutableCopy(Internal.BooleanList list)

    - #### emptyProtobufList

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

    - #### mutableCopy

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

    - #### parsePartialFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parsePartialFrom(T defaultInstance,
                                                                 CodedInputStream input)
                                                                    throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          java.nio.ByteBuffer data,
                                                          ExtensionRegistryLite extensionRegistry)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          java.nio.ByteBuffer data)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          ByteString data)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          ByteString data,
                                                          ExtensionRegistryLite extensionRegistry)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          byte[] data)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          byte[] data,
                                                          ExtensionRegistryLite extensionRegistry)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          java.io.InputStream input)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          java.io.InputStream input,
                                                          ExtensionRegistryLite extensionRegistry)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          CodedInputStream input)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseFrom(T defaultInstance,
                                                          CodedInputStream input,
                                                          ExtensionRegistryLite extensionRegistry)
                                                             throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseDelimitedFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance,
                                                                   java.io.InputStream input)
                                                                      throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`

    - #### parseDelimitedFrom

          protected static <T extends GeneratedMessageLite<T,?>> T parseDelimitedFrom(T defaultInstance,
                                                                   java.io.InputStream input,
                                                                   ExtensionRegistryLite extensionRegistry)
                                                                      throws InvalidProtocolBufferException

      Throws:
        `InvalidProtocolBufferException`