public static class JavaConstant.MethodType extends 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.MethodHandle, JavaConstant.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) |
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(Class<?> returnType,
Class<?>... parameterType)
Returns a method type description of the given return type and parameter types.
|
static JavaConstant.MethodType |
of(Constructor<?> constructor)
Returns a method type description of the given constructor.
|
static JavaConstant.MethodType |
of(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,
List<? extends TypeDescription> parameterTypes)
Returns a method type description of the given return type and parameter types.
|
static JavaConstant.MethodType |
ofConstant(Class<?> type)
Returns a method type for the given constant type.
|
static JavaConstant.MethodType |
ofConstant(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(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(Object methodType)
Returns a method type representation of a loaded
MethodType object. |
static JavaConstant.MethodType |
ofSetter(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.
|
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 JavaConstant.MethodType ofLoaded(Object methodType)
MethodType
object.methodType
- A method type object to represent as a JavaConstant
.JavaConstant.MethodType
.public static JavaConstant.MethodType of(Class<?> returnType, Class<?>... parameterType)
returnType
- The return type to represent.parameterType
- The parameter types to represent.public static JavaConstant.MethodType of(TypeDescription returnType, List<? extends TypeDescription> parameterTypes)
returnType
- The return type to represent.parameterTypes
- The parameter types to represent.public static JavaConstant.MethodType of(Method method)
method
- The method to extract the method type from.public static JavaConstant.MethodType of(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(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(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(Object instance)
instance
- The constant for which a constant method type should be created.public static JavaConstant.MethodType ofConstant(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 String getDescriptor()
public Object asConstantPoolValue()
JavaConstant
asConstantPoolValue
in interface JavaConstant
public StackManipulation asStackManipulation()
JavaConstant
asStackManipulation
in interface JavaConstant
public TypeDescription getType()
JavaConstant
getType
in interface JavaConstant
Copyright © 2014–2017. All rights reserved.