@Override public Object apply(UpperCase op, Map<String, Object> variables) { return EsIndexColumn.UPPERCASE_PREFIX + ((String)operand(op.getOperand()).apply(op.getOperand(), variables)); } };
public Transform(DynamicOperand operand) { // Check the transformation type if (operand instanceof UpperCase) { this.transform = TRANSFORM_UPPER_CASE; } else if (operand instanceof LowerCase) { this.transform = TRANSFORM_LOWER_CASE; } else { this.transform = TRANSFORM_NONE; } // Unwrap any nested transformations while (true) { if (operand instanceof UpperCase) { operand = ((UpperCase) operand).getOperand(); } else if (operand instanceof LowerCase) { operand = ((LowerCase) operand).getOperand(); } else { break; } } this.operand = operand; } }
public Transform(DynamicOperand operand) { // Check the transformation type if (operand instanceof UpperCase) { this.transform = TRANSFORM_UPPER_CASE; } else if (operand instanceof LowerCase) { this.transform = TRANSFORM_LOWER_CASE; } else { this.transform = TRANSFORM_NONE; } // Unwrap any nested transformations while (true) { if (operand instanceof UpperCase) { operand = ((UpperCase) operand).getOperand(); } else if (operand instanceof LowerCase) { operand = ((LowerCase) operand).getOperand(); } else { break; } } this.operand = operand; } }
/** * Returns the values of the given upper case operand at the given row. * * @param operand upper case operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Row row) throws RepositoryException { Value[] values = getValues(operand.getOperand(), row); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
/** * Returns the values of the given upper case operand for the given node. * * @param operand upper case operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Node node) throws RepositoryException { Value[] values = getValues(operand.getOperand(), node); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
/** * Returns the values of the given upper case operand at the given row. * * @param operand upper case operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Row row) throws RepositoryException { Value[] values = getValues(operand.getOperand(), row); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
/** * Returns the values of the given upper case operand at the given row. * * @param operand upper case operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Row row) throws RepositoryException { Value[] values = getValues(operand.getOperand(), row); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
/** * Returns the values of the given upper case operand for the given node. * * @param operand upper case operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Node node) throws RepositoryException { Value[] values = getValues(operand.getOperand(), node); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
/** * Returns the values of the given upper case operand for the given node. * * @param operand upper case operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getUpperCaseValues(UpperCase operand, Node node) throws RepositoryException { Value[] values = getValues(operand.getOperand(), node); for (int i = 0; i < values.length; i++) { String value = values[i].getString(); String upper = value.toUpperCase(locale); if (!value.equals(upper)) { values[i] = factory.createValue(upper); } } return values; }
private void append(UpperCase operand) { append("UPPER("); append(operand.getOperand()); append(")"); }
private void append(UpperCase operand) { append("UPPER("); append(operand.getOperand()); append(")"); }
private void append(UpperCase operand) { append("UPPER("); append(operand.getOperand()); append(")"); }
/** * Test case for {@link QueryObjectModelFactory#upperCase(DynamicOperand)} */ public void testUpperCase() throws RepositoryException { PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1); UpperCase upper = qf.upperCase(propValue); assertTrue("Not a property value operand", upper.getOperand() instanceof PropertyValue); } }
@Test public void upperCase() throws RepositoryException { PropertyValue p = f.propertyValue("selectorName", "propertyName"); Length length = f.length(p); UpperCase u = f.upperCase(length); assertEquals(length, u.getOperand()); assertEquals("UPPER(LENGTH([selectorName].[propertyName]))", u.toString()); }
} else if (operand instanceof UpperCase) { UpperCase upper = (UpperCase) operand; return getSelectorName(upper.getOperand()); } else { throw new UnsupportedRepositoryOperationException(
} else if (operand instanceof UpperCase) { UpperCase upper = (UpperCase) operand; return getSelectorName(upper.getOperand()); } else { throw new UnsupportedRepositoryOperationException(