org.mmbase.storage.search.implementation
Class BasicFieldValueConstraint

java.lang.Object
  extended by org.mmbase.storage.search.implementation.BasicConstraint
      extended by org.mmbase.storage.search.implementation.BasicFieldConstraint
          extended by org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
              extended by org.mmbase.storage.search.implementation.BasicFieldValueConstraint
All Implemented Interfaces:
Serializable, Constraint, FieldCompareConstraint, FieldConstraint, FieldValueConstraint
Direct Known Subclasses:
BasicFieldValueDateConstraint, BasicFunctionValueConstraint

public class BasicFieldValueConstraint
extends BasicFieldCompareConstraint
implements FieldValueConstraint, Serializable

Basic implementation. The tested operation is equality, unless it is explicitly set.

Since:
MMBase-1.7
Version:
$Id: BasicFieldValueConstraint.java 42627 2010-06-21 09:54:05Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.storage.search.implementation.BasicConstraint
modifiable
 
Fields inherited from interface org.mmbase.storage.search.FieldCompareConstraint
EQUAL, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LIKE, NOT_EQUAL, OPERATOR_DESCRIPTIONS, REGEXP
 
Constructor Summary
BasicFieldValueConstraint(StepField field, Object value)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 Object getValue()
          Gets the value to compare with.
 int hashCode()
           
 boolean matches(Object o)
          Determines whether a certain given value would match this constraint.
 BasicFieldValueConstraint setValue(Object value)
          Sets value property.
 String toString()
          Returns a string representation of this FieldValueConstraint.
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
getOperator, getOperatorDescription, setOperator
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldConstraint
getField, getFieldName, isCaseSensitive, setCaseSensitive
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicConstraint
getBasicSupportLevel, isInverse, setInverse, setUnmodifiable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.FieldCompareConstraint
getOperator
 
Methods inherited from interface org.mmbase.storage.search.FieldConstraint
getField, isCaseSensitive
 
Methods inherited from interface org.mmbase.storage.search.Constraint
getBasicSupportLevel, isInverse, setUnmodifiable
 

Constructor Detail

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.
Method Detail

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:

Specified by:
getValue in interface FieldValueConstraint

matches

public boolean matches(Object o)
Description copied from interface: FieldConstraint
Determines whether a certain given value would match this constraint.

Specified by:
matches in interface FieldConstraint
Specified by:
matches in interface FieldValueConstraint
Overrides:
matches in class BasicFieldConstraint

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
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 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

Specified by:
toString in interface FieldValueConstraint
Overrides:
toString in class BasicFieldCompareConstraint
Returns:
A string representation of this FieldValueConstraint.


MMBase 2.0-SNAPSHOT - null