org.gcube.data.trees.constraints
Class Same<T>

java.lang.Object
  extended by org.gcube.data.trees.constraints.BaseConstraint<T>
      extended by org.gcube.data.trees.constraints.Same<T>
All Implemented Interfaces:
Serializable, Constraint<T>

public class Same<T>
extends BaseConstraint<T>

Constrains values to be equal to a given one (in the Object.equals(Object) sense).

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
Same(Object o)
          Creates an instance from a value.
 
Method Summary
 boolean accepts(Object t)
          Returns true if a value satisfies the constraint.
 Object as()
           
 boolean equals(Object obj)
          
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Same

public Same(Object o)
Creates an instance from a value.

Parameters:
o - the value.
Method Detail

accepts

public boolean accepts(Object t)
Returns true if a value satisfies the constraint.

Parameters:
t - the value.
Returns:
true if the value satisfies the constraint, false if it does not.

toString

public String toString()

Overrides:
toString in class BaseConstraint<T>

as

public Object as()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.