org.mmbase.storage.search.implementation
Class BasicFieldValueConstraint
java.lang.Object
org.mmbase.storage.search.implementation.BasicConstraint
org.mmbase.storage.search.implementation.BasicFieldConstraint
org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
org.mmbase.storage.search.implementation.BasicFieldValueConstraint
- All Implemented Interfaces:
- Constraint, FieldCompareConstraint, FieldConstraint, FieldValueConstraint
- Direct Known Subclasses:
- BasicFieldValueDateConstraint
- public class BasicFieldValueConstraint
- extends BasicFieldCompareConstraint
- implements FieldValueConstraint
Basic implementation.
The tested operation is equality, unless it is explicitly set.
- Since:
- MMBase-1.7
- Version:
- $Id: BasicFieldValueConstraint.java,v 1.11 2005/04/25 14:56:57 pierre Exp $
- Author:
- Rob van Maris
BasicFieldValueConstraint
public BasicFieldValueConstraint(StepField field,
Object value)
- Constructor.
Depending on the field type, the value must be of type
String or Number.
- Parameters:
field - The associated field.value - The non-null property value.
- Throws:
IllegalArgumentException - when an invalid argument is supplied.
setValue
public BasicFieldValueConstraint setValue(Object value)
- Sets value property.
Depending on the field type, the value must be of type
String or Number.
- Parameters:
value - The non-null property value.
- Returns:
- This
BasicFieldValueConstraint instance.
- Throws:
IllegalArgumentException - when an invalid argument is supplied.
getValue
public Object getValue()
- Description copied from interface:
FieldValueConstraint
- Gets the value to compare with.
Depending on the field type, the value is of type
String or Number.
If the associated field type is of string type, when used in
combination with the operator LIKE, this may contain the
following wildcard characters as well:
- % for any string
- _ for a single character
- Specified by:
getValue in interface FieldValueConstraint
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 BasicFieldCompareConstraint
hashCode
public int hashCode()
- Specified by:
hashCode in interface Constraint- Overrides:
hashCode in class BasicFieldCompareConstraint
toString
public String toString()
- Description copied from interface:
FieldValueConstraint
- Returns a string representation of this FieldValueConstraint.
The string representation has the form
"FieldValueConstraint(inverse:<:inverse>, field:<field>,
casesensitive:<casesensitive>, operator:<operator>,
value:<value>)"
where
- <inverse>is the value returned by
isInverse()
- <field> is the field alias returned by
FieldConstraint#getField().getAlias(), or
FieldConstraint#getField().getFieldName()
when the former is null.
- <casesensitive> is the value returned by
isCaseSensitive()
- <operator> is the value returned by
(@link FieldCompareConstraint#getOperator getOperator()}
- <value> is the value returned by
getValue()
- Specified by:
toString in interface FieldValueConstraint- Overrides:
toString in class BasicFieldCompareConstraint
MMBase build 1.8.1.20060716