public class MethodSignature
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
clazz |
private java.lang.Class<?>[] |
parametersType |
private static java.lang.Class<?>[] |
ptypesnull |
private java.lang.Class<?> |
rtype |
Constructor and Description |
---|
MethodSignature(java.lang.Class<?> rtype)
Class constructor that receives the signature to define static members.
|
MethodSignature(java.lang.Class<?> rtype,
java.lang.Class<?> clazz)
Class constructor that receives the signature to define instance members or constructor without arguments.
|
MethodSignature(java.lang.Class<?> rtype,
java.lang.Class<?>[] parametersType)
Class constructor that receives the signature to define static members or constructors.
|
MethodSignature(java.lang.Class<?> rtype,
java.lang.Class<?> clazz,
java.lang.Class<?>[] parametersType)
Class constructor that receives the signature to define instance members.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Class<?> |
getClazz()
Gets the class the defined method belongs to.
|
java.lang.Class<?>[] |
getParametersType()
Gets the type of the parameters of the member
|
java.lang.Class<?> |
getRtype()
Gets the return type of the member.
|
int |
hashCode() |
boolean |
isStatic()
Tells whether the member is static.
|
private static java.lang.Class<?>[] ptypesnull
private final java.lang.Class<?> clazz
private final java.lang.Class<?> rtype
private java.lang.Class<?>[] parametersType
public MethodSignature(java.lang.Class<?> rtype, java.lang.Class<?> clazz, java.lang.Class<?>[] parametersType)
Counter
class that receives a long parameter and returns a long:MethodSignature methodSignature = new MethodSignature( long.class,Counter.class, new Class[] { long.class });
Counter
class to be modified whose type is long:MethodSignature methodSignature = new MethodSignature(void.class, Counter.class, new Class>[]{long.class});
rtype
- The return type of the member.clazz
- Class the member belongs to.parametersType
- Type of the parameters of the member.public MethodSignature(java.lang.Class<?> rtype, java.lang.Class<?>[] parametersType)
MethodSignature methodSignature = new MethodSignature( long.class,new Class[] { long.class });
MethodSignature methodSignature = new MethodSignature(void.class, new Class>[]{long.class});
MethodSignature methodSignature = new MethodSignature(Counter.class, new Class>[]{long.class});
rtype
- The return type of the member.parametersType
- Type of the parameters of the member.public MethodSignature(java.lang.Class<?> rtype, java.lang.Class<?> clazz)
Counter
class that returns a long:MethodSignature methodSignature = new MethodSignature( long.class,Counter.class);
Counter
class to be get its value whose type is long:MethodSignature methodSignature = new MethodSignature( long.class, Counter.class);
rtype
- The return type of the member.clazz
- Object of the class the member belongs to.public MethodSignature(java.lang.Class<?> rtype)
MethodSignature methodSignature = new MethodSignature( long.class);
MethodSignature methodSignature = new MethodSignature( long.class);
Counter
with no parameters:MethodSignature methodSignature = new MethodSignature(Counter.class);
rtype
- The return type of the member.public java.lang.Class<?> getClazz()
null
public java.lang.Class<?> getRtype()
public java.lang.Class<?>[] getParametersType()
public boolean isStatic()
true
if the member is static; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object