@Override public Object apply(LowerCase op, Map<String, Object> variables) { return EsIndexColumn.LOWERCASE_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 lower case operand for the given node. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
/** * Returns the values of the given lower case operand for the given node. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
/** * Returns the values of the given lower case operand at the given row. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
/** * Returns the values of the given lower case operand at the given row. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
/** * Returns the values of the given lower case operand at the given row. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
/** * Returns the values of the given lower case operand for the given node. * * @param operand lower 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[] getLowerCaseValues(LowerCase 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 lower = value.toLowerCase(locale); if (!value.equals(lower)) { values[i] = factory.createValue(lower); } } return values; }
private void append(LowerCase operand) { append("LOWER("); append(operand.getOperand()); append(")"); }
/** * Test case for {@link QueryObjectModelFactory#lowerCase(DynamicOperand)} */ public void testLowerCase() throws RepositoryException { PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1); LowerCase lower = qf.lowerCase(propValue); assertTrue("Not a property value operand", lower.getOperand() instanceof PropertyValue); }
private void append(LowerCase operand) { append("LOWER("); append(operand.getOperand()); append(")"); }
private void append(LowerCase operand) { append("LOWER("); append(operand.getOperand()); append(")"); }
@Test public void lowerCase() throws RepositoryException { PropertyValue p = f.propertyValue("selectorName", "propertyName"); Length length = f.length(p); LowerCase l = f.lowerCase(length); assertEquals(length, l.getOperand()); assertEquals("LOWER(LENGTH([selectorName].[propertyName]))", l.toString()); }
} else if (operand instanceof LowerCase) { LowerCase lower = (LowerCase) operand; return getSelectorName(lower.getOperand()); } else if (operand instanceof NodeLocalName) { NodeLocalName local = (NodeLocalName) operand;
} else if (operand instanceof LowerCase) { LowerCase lower = (LowerCase) operand; return getSelectorName(lower.getOperand()); } else if (operand instanceof NodeLocalName) { NodeLocalName local = (NodeLocalName) operand;