|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.virtualmock.call.Signature
The signature for a method call, representing the class, method name, and classes of the arguments. It is NOT a unique identifier for a call, since multiple calls can be recorded for the same signature.
| Constructor Summary | |
Signature(java.lang.Class returnType,
java.lang.Class classType,
java.lang.String methodName)
Creates a new Signature object with a return value but no arguments. |
|
Signature(java.lang.Class returnType,
java.lang.Class classType,
java.lang.String methodName,
java.lang.Class[] argTypes)
Creates a new Signature object with a return value and arguments. |
|
Signature(java.lang.Class classType,
java.lang.String methodName)
Creates a new Signature object with no return value or arguments. |
|
Signature(java.lang.Class classType,
java.lang.String methodName,
java.lang.Class[] argTypes)
Creates a new Signature object with no return value but with arguments. |
|
| Method Summary | |
protected void |
create(java.lang.Class newReturnType,
java.lang.Class newClassType,
java.lang.String newMethodName,
java.lang.Class[] newArgTypes)
Internal method which contains the logic to create a signature. |
boolean |
equals(java.lang.Object object)
Compares this Signature to another object. |
java.lang.Class[] |
getArgTypes()
Accessor. |
java.lang.String |
getClassName()
Returns the name of the class type of this Signature. |
java.lang.Class |
getClassType()
Accessor. |
java.lang.String |
getMethodName()
Accessor. |
java.lang.Class |
getReturnType()
Accessor. |
int |
hashCode()
Return hashCode for this Signature. |
boolean |
isAssignableFrom(Signature signature)
This method is similar to Java's Class.isAssignableFrom() method, but it checks the class type, method name and each individual argument type for this Signature. |
boolean |
isReturnTypePrimitive()
Returns true is return type is primitive. |
java.lang.String |
toString()
Represents this signature as a String. |
protected java.lang.String |
toStringWithoutReturnType()
Returns the representation of the Signature as a string, with the return type omitted. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Signature(java.lang.Class returnType,
java.lang.Class classType,
java.lang.String methodName,
java.lang.Class[] argTypes)
returnType - The type of the return value for this signatureclassType - The type of the class which owns this signaturemethodName - The name of the method for this signatureargTypes - Class array representing the argument types, or null if
there are no arguments.
public Signature(java.lang.Class returnType,
java.lang.Class classType,
java.lang.String methodName)
returnType - The type of the return value for this signatureclassType - The type of the class which owns this signaturemethodName - The name of the method for this signature
public Signature(java.lang.Class classType,
java.lang.String methodName,
java.lang.Class[] argTypes)
classType - The type of the class which owns this signaturemethodName - The name of the method for this signatureargTypes - Class array representing the argument types, or null if
there are no arguments.
public Signature(java.lang.Class classType,
java.lang.String methodName)
classType - The type of the class which owns this signaturemethodName - The name of the method for this signature| Method Detail |
public java.lang.Class[] getArgTypes()
public boolean isAssignableFrom(Signature signature)
This method is similar to Java's Class.isAssignableFrom() method, but it checks the class type, method name and each individual argument type for this Signature.
To paraphrase the javadoc for Class.isAssignableFrom(): "Determines if all argument types contained in this Signature object are either the same as, or are superclasses or superinterfaces of, the argument types of the Signature represented by the specified call parameter. It returns true if so; otherwise it returns false. If the argument types of this Signature object represent primitive types, the method returns true if the specified argument types of the Signature parameter are exactly this Calls argument objects; otherwise it returns false."
signature - the Signature which will be checked against this
Signature
public java.lang.String getClassName()
public java.lang.Class getClassType()
public java.lang.String getMethodName()
public java.lang.Class getReturnType()
public boolean isReturnTypePrimitive()
public boolean equals(java.lang.Object object)
object - The object with which we are comparing
public int hashCode()
public java.lang.String toString()
protected void create(java.lang.Class newReturnType,
java.lang.Class newClassType,
java.lang.String newMethodName,
java.lang.Class[] newArgTypes)
newReturnType - the returnType which will be used to create this
SignaturenewClassType - the classType which will be used to create this
SignaturenewMethodName - the methodName which will be used to create this
SignaturenewArgTypes - the argTypes which will be used to create this
Signatureprotected java.lang.String toStringWithoutReturnType()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||