@SuppressFBWarnings("BC_UNCONFIRMED_CAST") @Override public boolean semanticEquals(QueryCriteria obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ModIsQueryCriteria other = (ModIsQueryCriteria) obj; if (!this.getAttributeReference().equals(other.getAttributeReference())) { return false; } if (this.divisor != other.divisor && !this.divisor.equals(other.divisor)) { return false; } if (this.reminder != other.reminder && !this.reminder.equals(other.reminder)) { return false; } return true; }
@SuppressFBWarnings("BC_UNCONFIRMED_CAST") @Override public boolean semanticEquals(QueryCriteria obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AttributeAndValueQueryCriteria other = (AttributeAndValueQueryCriteria) obj; if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) { return false; } if (this.getAttributeReference() != other.getAttributeReference() && !this.getAttributeReference().equals(other.getAttributeReference())) { return false; } return true; } }
@Override public Boolean visit(IsEqualQueryCriteria criteria, KVValue<?> arg) { KVValue<?> referenced = resolve(criteria.getAttributeReference(), arg); if (referenced == null) { return false; } return criteria.getValue().equals(KVValueToScalarValue.fromDocValue(referenced)); }
@Override public Boolean visit(InQueryCriteria criteria, KVValue<?> arg) { KVValue<?> referenced = resolve(criteria.getAttributeReference(), arg); if (referenced == null) { return false; } ScalarValue<?> converted = KVValueToScalarValue.fromDocValue(referenced); for (ScalarValue<?> expectedValue : criteria.getValue()) { if (converted.equals(expectedValue)) { return true; } } return false; }