Lima-Loa

org.limaloa
Class Parameter

java.lang.Object
  extended by org.limaloa.Parameter

public final class Parameter
extends java.lang.Object

Encapsulates a method parameter. Designed as an immutable value object.

Author:
Chris Nappin

Constructor Summary
Parameter(java.lang.Class<?> parameterClass)
          Creates a new parameter.
Parameter(java.lang.String type)
          Creates a new parameter.
 
Method Summary
 boolean equals(java.lang.Object object)
          Value equality.
 java.lang.Class<?> getParameterClass()
          Get the parameter's class.
 int hashCode()
          Hash code, consistent with value equality.
 java.lang.String toString()
          Converts an instance to a string.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(java.lang.Class<?> parameterClass)
Creates a new parameter.

Parameters:
parameterClass - The class of the parameter

Parameter

public Parameter(java.lang.String type)
          throws java.lang.ClassNotFoundException
Creates a new parameter.

Parameters:
type - The class or primitive type of the parameter
Throws:
java.lang.ClassNotFoundException - If class not found
Method Detail

getParameterClass

public java.lang.Class<?> getParameterClass()
Get the parameter's class.

Returns:
The Class

equals

public boolean equals(java.lang.Object object)
Value equality.

Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare
Returns:
true if of equal value

hashCode

public int hashCode()
Hash code, consistent with value equality.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code

toString

public java.lang.String toString()
Converts an instance to a string.

Overrides:
toString in class java.lang.Object
Returns:
The string representation

Lima-Loa