@Override public int hashCode() { return m_property.hashCode() ^ m_operator.hashCode() ^ m_value.hashCode(); }
@Override public String toString() { return name() + "[" + symbol + ", " + abbreviation + "]"; }
public static Operator fromAbbreviation(String abbreviation) throws InvalidOperatorException { for (Operator operator : Operator.values()) { if (operator.abbreviation.equals(abbreviation)) { return operator; } } throw new InvalidOperatorException("Operator, '" + abbreviation + "' does not match one of eq, has, gt, ge, lt, or le."); }
public Condition(String property, String operator, String value) throws InvalidOperatorException, QueryParseException { m_property = property; m_operator = Operator.fromAbbreviation(operator); if (value.indexOf("'") != -1) { throw new QueryParseException("Query cannot contain the ' character."); } m_value = value; }
whereClause.append(" AND"); String op = cond.getOperator().getSymbol(); String prop = cond.getProperty(); if (prop.toLowerCase().endsWith("date")) {
/** * Convert a local {@link Condition} into a WSDL-style * {@link org.fcrepo.server.types.gen.Condition Condition}. */ public static org.fcrepo.server.types.gen.Condition convertConditionToGenCondition(Condition condition) { String opAbbr = condition.getOperator().getAbbreviation(); ComparisonOperator compOperator; try { compOperator = ComparisonOperator.fromValue(opAbbr); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("unrecognized comparison operator string: '" + opAbbr + "'"); } org.fcrepo.server.types.gen.Condition cond = new org.fcrepo.server.types.gen.Condition(); cond.setProperty(condition.getProperty()); cond.setOperator(compOperator); cond.setValue(condition.getValue()); return cond; }
public Condition(String property, String operator, String value) throws InvalidOperatorException, QueryParseException { m_property = property; m_operator = Operator.fromAbbreviation(operator); if (value.indexOf("'") != -1) { throw new QueryParseException("Query cannot contain the ' character."); } m_value = value; }
whereClause.append(" AND"); String op = cond.getOperator().getSymbol(); String prop = cond.getProperty(); if (prop.toLowerCase().endsWith("date")) {
public static Operator fromAbbreviation(String abbreviation) throws InvalidOperatorException { for (Operator operator : Operator.values()) { if (operator.abbreviation.equals(abbreviation)) { return operator; } } throw new InvalidOperatorException("Operator, '" + abbreviation + "' does not match one of eq, has, gt, ge, lt, or le."); }
@Override public int hashCode() { return m_property.hashCode() ^ m_operator.hashCode() ^ m_value.hashCode(); }
@Override public String toString() { return name() + "[" + symbol + ", " + abbreviation + "]"; }