org.gcube.contentmanagement.contentmanager.stubs.model.constraints
Class Same<T>

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.model.constraints.BaseConstraint<T>
      extended by org.gcube.contentmanagement.contentmanager.stubs.model.constraints.Same<T>
All Implemented Interfaces:
java.io.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 (University of Strathclyde)
See Also:
Serialized Form

Method Summary
 boolean accepts(java.lang.Object t)
          Indicates whether a value satisfies the constraint.
 java.lang.Object as()
           
 boolean equals(java.lang.Object obj)
          
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

accepts

public boolean accepts(java.lang.Object t)
Indicates whether a value satisfies the constraint.

Parameters:
t - the value.
Returns:
true if it does, false otherwise.

toString

public java.lang.String toString()

Overrides:
toString in class BaseConstraint<T>

as

public java.lang.Object as()

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object