org.mmbase.storage.search.implementation
Class BasicFieldCompareConstraint
java.lang.Object
org.mmbase.storage.search.implementation.BasicConstraint
org.mmbase.storage.search.implementation.BasicFieldConstraint
org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
- All Implemented Interfaces:
- Serializable, Constraint, FieldCompareConstraint, FieldConstraint
- Direct Known Subclasses:
- BasicCompareFieldsConstraint, BasicFieldValueConstraint
public class BasicFieldCompareConstraint
- extends BasicFieldConstraint
- implements FieldCompareConstraint, Serializable
Basic implementation.
The tested operation is equality, unless it is explicitly set.
- Since:
- MMBase-1.7
- Version:
- $Id: BasicFieldCompareConstraint.java 41969 2010-04-20 11:54:02Z michiel $
- Author:
- Rob van Maris
- See Also:
- Serialized Form
BasicFieldCompareConstraint
protected BasicFieldCompareConstraint(StepField field)
- Constructor.
Protected, so only subclasses can be instantiated.
- Parameters:
field - The associated field.
- Throws:
IllegalArgumentException - when an invalid argument is supplied.
setOperator
public BasicFieldCompareConstraint setOperator(int operator)
- Sets operator.
- Parameters:
operator - the operator value
- Returns:
- This
BasicFieldCompareConstraint instance.
- Throws:
IllegalArgumentException - when an invalid argument is supplied.
getOperator
public int getOperator()
- Description copied from interface:
FieldCompareConstraint
- Gets the operator used to compare values.
This must be one of the values declared here.
The value
LIKE is allowed only when the associated field
is of string type.
- Specified by:
getOperator in interface FieldCompareConstraint
getOperatorDescription
public String getOperatorDescription()
- Returns a description of the operator
equals
public boolean equals(Object obj)
- Description copied from interface:
Constraint
- Compares this constraint to the specified object. The result is
true if and only if the argument is a non-null
Constraint object representing the same constraint(s).
- Specified by:
equals in interface Constraint- Overrides:
equals in class BasicFieldConstraint
- Parameters:
obj - The object to compare with.
- Returns:
true if the objects are equal,
false otherwise.
hashCode
public int hashCode()
- Specified by:
hashCode in interface Constraint- Overrides:
hashCode in class BasicFieldConstraint
toString
public String toString()
- Overrides:
toString in class BasicFieldConstraint
MMBase 2.0-SNAPSHOT - null