@Test public void expressionEvaluator_givenExpression_shoulReturnCorrectValue() { String expression = "Year"; Iterable<Record> recordIterator = csvResolver.bindSource(LSOURCE, sourceResolver).get(); ExpressionEvaluatorFactory<Record> evaluatorFactory = csvResolver.getExpressionEvaluatorFactory(); List<Record> records = Lists.newArrayList(recordIterator); EvaluateExpression evaluateExpression = evaluatorFactory.apply(records.get(0)); assertThat(evaluateExpression.apply(expression).get(), is("1997")); }
@Override public ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory() { return entry -> expression -> { logEvaluateExpression(expression, LOG); return Optional.ofNullable(entry.getString(expression)); }; }
CsvResolver implements LogicalSourceResolver<Record> { @Override public ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory() { return entry -> expression -> { logEvaluateExpression(expression, LOG); return Optional.ofNullable(entry.getString(expression)); }; } }
CsvResolver implements LogicalSourceResolver<Record> { @Override public ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory() { return entry -> expression -> { logEvaluateExpression(expression, LOG); return Optional.ofNullable(entry.getString(expression)); }; }  }
CsvResolver implements LogicalSourceResolver<Record> { @Override public ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory() { return entry -> expression -> { logEvaluateExpression(expression, LOG); return Optional.ofNullable(entry.getString(expression)); }; }  @Override SourceIterator<Record> getSourceIterator(); @Override ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory(); }
CsvResolver implements LogicalSourceResolver<Record> { @Override public ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory() { return entry -> expression -> { logEvaluateExpression(expression, LOG); return Optional.ofNullable(entry.getString(expression)); }; }  @Override SourceIterator<Record> getSourceIterator(); @Override ExpressionEvaluatorFactory<Record> getExpressionEvaluatorFactory();  }