@Test @Ignore("Takes too long") public void test10MIterationsWithQuery() { final Map<String, String> attrs = new HashMap<>(); attrs.put("xx", "world"); final long start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { assertEquals("world", Query.evaluateExpressions("${xx}", attrs)); } final long nanos = System.nanoTime() - start; System.out.println(TimeUnit.NANOSECONDS.toMillis(nanos)); }
@Override public String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables) throws ProcessException { final StringBuilder sb = new StringBuilder(); for (final Expression expression : expressions) { final String evaluated = expression.evaluate(valMap, decorator, stateVariables); if (evaluated != null) { sb.append(evaluated); } } return sb.toString(); }
StandardPreparedQuery implements PreparedQuery { @Override public String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables) throws ProcessException { final StringBuilder sb = new StringBuilder(); for (final Expression expression : expressions) { final String evaluated = expression.evaluate(valMap, decorator, stateVariables); if (evaluated != null) { sb.append(evaluated); } } return sb.toString(); } }
StandardPreparedQuery implements PreparedQuery { @Override public String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables) throws ProcessException { final StringBuilder sb = new StringBuilder(); for (final Expression expression : expressions) { final String evaluated = expression.evaluate(valMap, decorator, stateVariables); if (evaluated != null) { sb.append(evaluated); } } return sb.toString(); } StandardPreparedQuery(final List<Expression> expressions); }
StandardPreparedQuery implements PreparedQuery { @Override public String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables) throws ProcessException { final StringBuilder sb = new StringBuilder(); for (final Expression expression : expressions) { final String evaluated = expression.evaluate(valMap, decorator, stateVariables); if (evaluated != null) { sb.append(evaluated); } } return sb.toString(); } StandardPreparedQuery(final List<Expression> expressions); @Override String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables); @Override String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator); @Override boolean isExpressionLanguagePresent(); @Override VariableImpact getVariableImpact(); }
StandardPreparedQuery implements PreparedQuery { @Override public String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables) throws ProcessException { final StringBuilder sb = new StringBuilder(); for (final Expression expression : expressions) { final String evaluated = expression.evaluate(valMap, decorator, stateVariables); if (evaluated != null) { sb.append(evaluated); } } return sb.toString(); } StandardPreparedQuery(final List<Expression> expressions); @Override String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator, final Map<String, String> stateVariables); @Override String evaluateExpressions(final Map<String, String> valMap, final AttributeValueDecorator decorator); @Override boolean isExpressionLanguagePresent(); @Override VariableImpact getVariableImpact();  }