com.google.protobuf

## Class Extension<ContainingType extends MessageLite,Type>

- java.lang.Object
- - com.google.protobuf.ExtensionLite<ContainingType,Type>
  - - com.google.protobuf.Extension<ContainingType,Type>

- Direct Known Subclasses:
    GeneratedMessage.GeneratedExtension

      public abstract class Extension<ContainingType extends MessageLite,Type>
      extends ExtensionLite<ContainingType,Type>

  Interface that generated extensions implement.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `Extension.ExtensionType` The API type that the extension is used for.
    `static class` | `Extension.MessageType` Type of a message extension.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Extension()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract java.lang.Object` | `fromReflectionType(java.lang.Object value)`
    `abstract Descriptors.FieldDescriptor` | `getDescriptor()` Returns the descriptor of the extension.
    `protected Extension.ExtensionType` | `getExtensionType()`
    `Extension.MessageType` | `getMessageType()` If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined.
    `protected abstract java.lang.Object` | `singularFromReflectionType(java.lang.Object value)`
    `protected abstract java.lang.Object` | `singularToReflectionType(java.lang.Object value)`
    `protected abstract java.lang.Object` | `toReflectionType(java.lang.Object value)`

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

      `getDefaultValue, getLiteType, getMessageDefaultInstance, getNumber, isRepeated`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Extension

          public Extension()

  - ### Method Detail

    - #### getDescriptor

          public abstract Descriptors.FieldDescriptor getDescriptor()

      Returns the descriptor of the extension.

    - #### getExtensionType

          protected Extension.ExtensionType getExtensionType()

    - #### getMessageType

          public Extension.MessageType getMessageType()

      If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined.

    - #### fromReflectionType

          protected abstract java.lang.Object fromReflectionType(java.lang.Object value)

    - #### singularFromReflectionType

          protected abstract java.lang.Object singularFromReflectionType(java.lang.Object value)

    - #### toReflectionType

          protected abstract java.lang.Object toReflectionType(java.lang.Object value)

    - #### singularToReflectionType

          protected abstract java.lang.Object singularToReflectionType(java.lang.Object value)