public static class JavaConstant.MethodType extends java.lang.Object implements JavaConstant
java.lang.invoke.MethodType
object.Modifier and Type | Class and Description |
---|---|
protected static interface |
JavaConstant.MethodType.Dispatcher
A dispatcher for extracting information from a
java.lang.invoke.MethodType instance. |
JavaConstant.Dynamic, JavaConstant.MethodHandle, JavaConstant.MethodType
Modifier and Type | Field and Description |
---|---|
private static JavaConstant.MethodType.Dispatcher |
DISPATCHER
A dispatcher for extracting information from a
java.lang.invoke.MethodType instance. |
private java.util.List<? extends TypeDescription> |
parameterTypes
The parameter types of this method type.
|
private TypeDescription |
returnType
The return type of this method type.
|
Modifier | Constructor and Description |
---|---|
protected |
MethodType(TypeDescription returnType,
java.util.List<? extends TypeDescription> parameterTypes)
Creates a method type for the given types.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
asConstantPoolValue()
Returns the represented instance as a constant pool value.
|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getDescriptor()
Returns the method descriptor of this method type representation.
|
TypeList |
getParameterTypes()
Returns the parameter types of this method type.
|
TypeDescription |
getReturnType()
Returns the return type of this method type.
|
TypeDescription |
getType()
Returns a description of the type of the represented instance or at least a stub.
|
int |
hashCode() |
static JavaConstant.MethodType |
of(java.lang.Class<?> returnType,
java.lang.Class<?>... parameterType)
Returns a method type description of the given return type and parameter types.
|
static JavaConstant.MethodType |
of(java.lang.reflect.Constructor<?> constructor)
Returns a method type description of the given constructor.
|
static JavaConstant.MethodType |
of(java.lang.reflect.Method method)
Returns a method type description of the given method.
|
static JavaConstant.MethodType |
of(MethodDescription methodDescription)
Returns a method type description of the given method.
|
static JavaConstant.MethodType |
of(TypeDescription returnType,
java.util.List<? extends TypeDescription> parameterTypes)
Returns a method type description of the given return type and parameter types.
|
static JavaConstant.MethodType |
ofConstant(java.lang.Class<?> type)
Returns a method type for the given constant type.
|
static JavaConstant.MethodType |
ofConstant(java.lang.Object instance)
Returns a method type for the given constant.
|
static JavaConstant.MethodType |
ofConstant(TypeDescription typeDescription)
Returns a method type for the given constant type.
|
static JavaConstant.MethodType |
ofGetter(java.lang.reflect.Field field)
Returns a method type for a getter of the given field.
|
static JavaConstant.MethodType |
ofGetter(FieldDescription fieldDescription)
Returns a method type for a getter of the given field.
|
static JavaConstant.MethodType |
ofLoaded(java.lang.Object methodType)
Returns a method type representation of a loaded
MethodType object. |
static JavaConstant.MethodType |
ofSetter(java.lang.reflect.Field field)
Returns a method type for a setter of the given field.
|
static JavaConstant.MethodType |
ofSetter(FieldDescription fieldDescription)
Returns a method type for a setter of the given field.
|
private static final JavaConstant.MethodType.Dispatcher DISPATCHER
java.lang.invoke.MethodType
instance.private final TypeDescription returnType
private final java.util.List<? extends TypeDescription> parameterTypes
protected MethodType(TypeDescription returnType, java.util.List<? extends TypeDescription> parameterTypes)
returnType
- The return type of the method type.parameterTypes
- The parameter types of the method type.public static JavaConstant.MethodType ofLoaded(java.lang.Object methodType)
MethodType
object.methodType
- A method type object to represent as a JavaConstant
.JavaConstant.MethodType
.public static JavaConstant.MethodType of(java.lang.Class<?> returnType, java.lang.Class<?>... parameterType)
returnType
- The return type to represent.parameterType
- The parameter types to represent.public static JavaConstant.MethodType of(TypeDescription returnType, java.util.List<? extends TypeDescription> parameterTypes)
returnType
- The return type to represent.parameterTypes
- The parameter types to represent.public static JavaConstant.MethodType of(java.lang.reflect.Method method)
method
- The method to extract the method type from.public static JavaConstant.MethodType of(java.lang.reflect.Constructor<?> constructor)
constructor
- The constructor to extract the method type from.public static JavaConstant.MethodType of(MethodDescription methodDescription)
methodDescription
- The method to extract the method type from.public static JavaConstant.MethodType ofSetter(java.lang.reflect.Field field)
field
- The field to extract a setter type for.public static JavaConstant.MethodType ofSetter(FieldDescription fieldDescription)
fieldDescription
- The field to extract a setter type for.public static JavaConstant.MethodType ofGetter(java.lang.reflect.Field field)
field
- The field to extract a getter type for.public static JavaConstant.MethodType ofGetter(FieldDescription fieldDescription)
fieldDescription
- The field to extract a getter type for.public static JavaConstant.MethodType ofConstant(java.lang.Object instance)
instance
- The constant for which a constant method type should be created.public static JavaConstant.MethodType ofConstant(java.lang.Class<?> type)
type
- The constant type for which a constant method type should be created.public static JavaConstant.MethodType ofConstant(TypeDescription typeDescription)
typeDescription
- The constant type for which a constant method type should be created.public TypeDescription getReturnType()
public TypeList getParameterTypes()
public java.lang.String getDescriptor()
public java.lang.Object asConstantPoolValue()
asConstantPoolValue
in interface JavaConstant
public TypeDescription getType()
getType
in interface JavaConstant
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object