Lima-Loa

org.limaloa
Class MethodMapping

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

public final class MethodMapping
extends java.lang.Object

Encapsulates a Method Mapping. Designed as an immutable value object.

Author:
Chris Nappin

Constructor Summary
MethodMapping(Method source, Method target)
          Creates a new method mapping.
MethodMapping(Method source, Method target, java.util.List<ExceptionMapping> exceptionMappings)
          Creates a new method mapping.
MethodMapping(java.lang.String source, java.lang.String target)
          Creates a new method mapping, selecting methods by name alone.
MethodMapping(java.lang.String source, java.lang.String target, java.util.List<ExceptionMapping> exceptionMappings)
          Creates a new method mapping, selecting methods by name alone.
 
Method Summary
 boolean equals(java.lang.Object object)
          Value equality.
 java.util.List<ExceptionMapping> getExceptionMappings()
          Get the exception mappings (if any).
 Method getSource()
          Get the source method.
 Method getTarget()
          Get the target method.
 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

MethodMapping

public MethodMapping(Method source,
                     Method target,
                     java.util.List<ExceptionMapping> exceptionMappings)
Creates a new method mapping.

Parameters:
source - The source method
target - The target method
exceptionMappings - The exception mappings (if any)

MethodMapping

public MethodMapping(Method source,
                     Method target)
Creates a new method mapping.

Parameters:
source - The source method
target - The target method

MethodMapping

public MethodMapping(java.lang.String source,
                     java.lang.String target,
                     java.util.List<ExceptionMapping> exceptionMappings)
Creates a new method mapping, selecting methods by name alone.

Parameters:
source - The source method name
target - The target method name
exceptionMappings - The exception mappings (if any)

MethodMapping

public MethodMapping(java.lang.String source,
                     java.lang.String target)
Creates a new method mapping, selecting methods by name alone.

Parameters:
source - The source method name
target - The target method name
Method Detail

getSource

public Method getSource()
Get the source method.

Returns:
the method

getTarget

public Method getTarget()
Get the target method.

Returns:
the method

getExceptionMappings

public java.util.List<ExceptionMapping> getExceptionMappings()
Get the exception mappings (if any).

Returns:
a List of ExceptionMapping, possibly empty (indicating no mappings) 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