Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.util
Class IdentityWrapper<T>

java.lang.Object
  extended by eu.esdihumboldt.util.IdentityWrapper<T>
Type Parameters:
T - the value type

@Immutable
public class IdentityWrapper<T>
extends Object

Class that defines its equals(Object) and hashCode() based on the contained values identity.

Author:
Simon Templer

Constructor Summary
IdentityWrapper(T value)
          Create a wrapper for the given value.
 
Method Summary
 boolean equals(Object obj)
           
 T getValue()
          Get the contained value.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityWrapper

public IdentityWrapper(T value)
Create a wrapper for the given value.

Parameters:
value - the value to wrap, if the value is an IdentityWrapper, its value will be extracted and used as the value to wrap
Method Detail

getValue

public T getValue()
Get the contained value.

Returns:
the value

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d