01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.storage.search.implementation;
11:
12: import org.mmbase.storage.search.*;
13:
14: /**
15: * Basic implementation.
16: *
17: * @author Rob van Maris
18: * @version $Id: BasicFieldNullConstraint.java,v 1.5 2006/10/16 12:56:57 pierre Exp $
19: * @since MMBase-1.7
20: */
21: public class BasicFieldNullConstraint extends BasicFieldConstraint
22: implements FieldNullConstraint {
23:
24: /**
25: * Constructor.
26: *
27: * @param field The associated field.
28: * @throws IllegalArgumentException when an invalid argument is supplied.
29: */
30: public BasicFieldNullConstraint(StepField field) {
31: super (field);
32: }
33:
34: // javadoc is inherited
35: public boolean equals(Object obj) {
36: // Must be same class (subclasses should override this)!
37: if (obj != null && obj.getClass() == getClass()) {
38: BasicFieldNullConstraint constraint = (BasicFieldNullConstraint) obj;
39: return isInverse() == constraint.isInverse()
40: && isCaseSensitive() == constraint
41: .isCaseSensitive()
42: && getField().getFieldName().equals(
43: constraint.getField().getFieldName())
44: && BasicStepField.compareSteps(
45: getField().getStep(), constraint.getField()
46: .getStep());
47: } else {
48: return false;
49: }
50: }
51:
52: // javadoc is inherited
53: public int hashCode() {
54: return super .hashCode();
55: }
56:
57: // javadoc is inherited
58: public String toString() {
59: StringBuilder sb = new StringBuilder(
60: "FieldNullConstraint(inverse:").append(isInverse())
61: .append(", field:").append(getFieldName()).append(
62: ", casesensitive:").append(isCaseSensitive())
63: .append(")");
64: return sb.toString();
65: }
66: }
|