Package com.google.protobuf
Class Extension<ContainingType extends MessageLite,Type>
- java.lang.Object
-
- com.google.protobuf.Extension<ContainingType,Type>
-
- Direct Known Subclasses:
GeneratedMessage.GeneratedExtension
public abstract class Extension<ContainingType extends MessageLite,Type> extends java.lang.ObjectInterface that generated extensions implement.- Author:
- liujisi@google.com (Jisi Liu)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classExtension.ExtensionTypeThe API type that the extension is used for.static classExtension.MessageTypeType of a message extension.
-
Constructor Summary
Constructors Constructor Description Extension()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.ObjectfromReflectionType(java.lang.Object value)abstract TypegetDefaultValue()Returns the default value of the extension field.abstract Descriptors.FieldDescriptorgetDescriptor()Returns the descriptor of the extension.protected Extension.ExtensionTypegetExtensionType()abstract WireFormat.FieldTypegetLiteType()Returns the type of the field.abstract MessageLitegetMessageDefaultInstance()Returns the default instance of the extension field, if it's a message extension.Extension.MessageTypegetMessageType()If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined.abstract intgetNumber()Returns the field number of the extension.abstract booleanisRepeated()Returns whether it is a repeated field.protected abstract java.lang.ObjectsingularFromReflectionType(java.lang.Object value)protected abstract java.lang.ObjectsingularToReflectionType(java.lang.Object value)protected abstract java.lang.ObjecttoReflectionType(java.lang.Object value)
-
-
-
Method Detail
-
getNumber
public abstract int getNumber()
Returns the field number of the extension.
-
getLiteType
public abstract WireFormat.FieldType getLiteType()
Returns the type of the field.
-
isRepeated
public abstract boolean isRepeated()
Returns whether it is a repeated field.
-
getDescriptor
public abstract Descriptors.FieldDescriptor getDescriptor()
Returns the descriptor of the extension.
-
getDefaultValue
public abstract Type getDefaultValue()
Returns the default value of the extension field.
-
getMessageDefaultInstance
public abstract MessageLite getMessageDefaultInstance()
Returns the default instance of the extension field, if it's a message 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)
-
-