Lima-Loa

org.limaloa
Class Method

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

public final class Method
extends java.lang.Object

Encapsulates a method. Designed as an immutable value object.

Author:
Chris Nappin

Constructor Summary
Method(java.lang.String name)
          Creates a new method, selecting by method name alone.
Method(java.lang.String name, java.util.List<Parameter> parameters)
          Creates a new method.
 
Method Summary
 boolean equals(java.lang.Object object)
          Value equality.
 java.lang.String getName()
          Get the method name.
 java.util.List<Parameter> getParameters()
          Get the method parameters (if not selecting by method name alone).
 int hashCode()
          Hash code, consistent with value equality.
 boolean isAnyParameters()
          Get whether to select by method name alone.
 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

Method

public Method(java.lang.String name)
Creates a new method, selecting by method name alone. If method is overloaded then this will be a configuration error.

Parameters:
name - The name of the method

Method

public Method(java.lang.String name,
              java.util.List<Parameter> parameters)
Creates a new method.

Parameters:
name - The name of the method
parameters - List of Parameter
Method Detail

getName

public java.lang.String getName()
Get the method name.

Returns:
The name

isAnyParameters

public boolean isAnyParameters()
Get whether to select by method name alone.

Returns:
true if select by method name alone

getParameters

public java.util.List<Parameter> getParameters()
Get the method parameters (if not selecting by method name alone).

Returns:
a List of Parameter, possibly empty (indicating void) but never null.

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