org.mmbase.storage.search.implementation
Class BasicFieldValueDateConstraint
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
org.mmbase.storage.search.implementation.BasicFieldValueDateConstraint
- All Implemented Interfaces:
- Serializable, Constraint, FieldCompareConstraint, FieldConstraint, FieldValueConstraint, FieldValueDateConstraint
public class BasicFieldValueDateConstraint
- extends BasicFieldValueConstraint
- implements FieldValueDateConstraint, Serializable
A constraint on a 'part' of a DateTime field. E.g. where extract(YEAR, lastmodified) = 2004.
- Since:
- MMBase-1.8
- Version:
- $Id: BasicFieldValueDateConstraint.java 41982 2010-04-20 14:05:14Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
| Fields inherited from interface org.mmbase.storage.search.FieldValueDateConstraint |
CENTURY, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, HOUR, MILLISECOND, MINUTE, MONTH, PART_DESCRIPTIONS, QUARTER, SECOND, WEEK, YEAR |
BasicFieldValueDateConstraint
public BasicFieldValueDateConstraint(StepField field,
Object value,
int part)
- 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.part - Which part of the date to compare
- Throws:
IllegalArgumentException - when an invalid argument is supplied.
getPart
public int getPart()
- Description copied from interface:
FieldValueDateConstraint
- Returns the part of the date-field wich is to be compared.
- Specified by:
getPart in interface FieldValueDateConstraint
getPartDescription
public String getPartDescription()
- Returns a description of the part
setPart
public void setPart(int p)
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 BasicFieldValueConstraint
- 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 BasicFieldValueConstraint
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 BasicFieldValueConstraint
- Returns:
- A string representation of this FieldValueConstraint.
MMBase 2.0-SNAPSHOT - null