public static class JavaInstance.MethodType extends Object implements JavaInstance
java.lang.invoke.MethodType object.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
JavaInstance.MethodType.Dispatcher
A dispatcher for extracting information from a
java.lang.invoke.MethodType instance. |
JavaInstance.MethodHandle, JavaInstance.MethodType| Modifier | Constructor and Description |
|---|---|
protected |
MethodType(TypeDescription returnType,
List<? extends TypeDescription> parameterTypes)
Creates a method type for the given types.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
asConstantPoolValue()
Returns the represented instance as a constant pool value.
|
StackManipulation |
asStackManipulation()
Returns the instance as loadable onto the operand stack.
|
boolean |
equals(Object other) |
TypeDescription |
getInstanceType()
Returns a description of the type of the represented instance or at least a stub.
|
List<TypeDescription> |
getParameterTypes()
Returns the parameter types of this method type.
|
TypeDescription |
getReturnType()
Returns the return type of this method type.
|
int |
hashCode() |
static JavaInstance.MethodType |
of(Class<?> returnType,
Class<?>... parameterType)
Returns a method type description of the given return type and parameter types.
|
static JavaInstance.MethodType |
of(Constructor<?> constructor)
Returns a method type description of the given constructor.
|
static JavaInstance.MethodType |
of(Method method)
Returns a method type description of the given method.
|
static JavaInstance.MethodType |
of(MethodDescription methodDescription)
Returns a method type description of the given method.
|
static JavaInstance.MethodType |
of(Object methodType)
Returns a method type representation of a loaded
MethodType object. |
static JavaInstance.MethodType |
of(TypeDescription returnType,
List<? extends TypeDescription> parameterTypes)
Returns a method type description of the given return type and parameter types.
|
static JavaInstance.MethodType |
ofConstant(Class<?> type)
Returns a method type for the given constant type.
|
static JavaInstance.MethodType |
ofConstant(Object instance)
Returns a method type for the given constant.
|
static JavaInstance.MethodType |
ofConstant(TypeDescription typeDescription)
Returns a method type for the given constant type.
|
static JavaInstance.MethodType |
ofGetter(Field field)
Returns a method type for a getter of the given field.
|
static JavaInstance.MethodType |
ofGetter(FieldDescription fieldDescription)
Returns a method type for a getter of the given field.
|
static JavaInstance.MethodType |
ofSetter(Field field)
Returns a method type for a setter of the given field.
|
static JavaInstance.MethodType |
ofSetter(FieldDescription fieldDescription)
Returns a method type for a setter of the given field.
|
String |
toString() |
protected MethodType(TypeDescription returnType, List<? extends TypeDescription> parameterTypes)
returnType - The return type of the method type.parameterTypes - The parameter types of the method type.public static JavaInstance.MethodType of(Object methodType)
MethodType object.methodType - A method type object to represent as a JavaInstance.JavaInstance.public static JavaInstance.MethodType of(Class<?> returnType, Class<?>... parameterType)
returnType - The return type to represent.parameterType - The parameter types to represent.public static JavaInstance.MethodType of(TypeDescription returnType, List<? extends TypeDescription> parameterTypes)
returnType - The return type to represent.parameterTypes - The parameter types to represent.public static JavaInstance.MethodType of(Method method)
method - The method to extract the method type from.public static JavaInstance.MethodType of(Constructor<?> constructor)
constructor - The constructor to extract the method type from.public static JavaInstance.MethodType of(MethodDescription methodDescription)
methodDescription - The method to extract the method type from.public static JavaInstance.MethodType ofSetter(Field field)
field - The field to extract a setter type for.public static JavaInstance.MethodType ofSetter(FieldDescription fieldDescription)
fieldDescription - The field to extract a setter type for.public static JavaInstance.MethodType ofGetter(Field field)
field - The field to extract a getter type for.public static JavaInstance.MethodType ofGetter(FieldDescription fieldDescription)
fieldDescription - The field to extract a getter type for.public static JavaInstance.MethodType ofConstant(Object instance)
instance - The constant for which a constant method type should be created.public static JavaInstance.MethodType ofConstant(Class<?> type)
type - The constant type for which a constant method type should be created.public static JavaInstance.MethodType ofConstant(TypeDescription typeDescription)
typeDescription - The constant type for which a constant method type should be created.public TypeDescription getReturnType()
public List<TypeDescription> getParameterTypes()
public Object asConstantPoolValue()
JavaInstanceasConstantPoolValue in interface JavaInstancepublic StackManipulation asStackManipulation()
JavaInstanceasStackManipulation in interface JavaInstancepublic TypeDescription getInstanceType()
JavaInstancegetInstanceType in interface JavaInstanceCopyright © 2014–2015. All rights reserved.