Class Extension<ContainingType,Type>

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

Interface that generated extensions implement.

Inheritance

Object > ExtensionLite > Extension<ContainingType,Type>

Type Parameters

NameDescription
ContainingType
Type

Constructors

Extension()

public Extension()

Methods

fromReflectionType(Object value)

protected abstract Object fromReflectionType(Object value)
Parameter
NameDescription
valueObject
Returns
TypeDescription
Object

getDescriptor()

public abstract Descriptors.FieldDescriptor getDescriptor()

Returns the descriptor of the extension.

Returns
TypeDescription
Descriptors.FieldDescriptor

getExtensionType()

protected abstract Extension.ExtensionType getExtensionType()
Returns
TypeDescription
Extension.ExtensionType

getMessageDefaultInstance()

public abstract Message getMessageDefaultInstance()

Returns the default instance of the extension field, if it's a message extension. Overridden to return Message instead of MessageLite.

Returns
TypeDescription
Message
Overrides

getMessageType()

public Extension.MessageType getMessageType()

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

Returns
TypeDescription
Extension.MessageType

singularFromReflectionType(Object value)

protected abstract Object singularFromReflectionType(Object value)
Parameter
NameDescription
valueObject
Returns
TypeDescription
Object

singularToReflectionType(Object value)

protected abstract Object singularToReflectionType(Object value)
Parameter
NameDescription
valueObject
Returns
TypeDescription
Object

toReflectionType(Object value)

protected abstract Object toReflectionType(Object value)
Parameter
NameDescription
valueObject
Returns
TypeDescription
Object