GitHub user wardva opened a pull request: https://github.com/apache/beam/pull/3934
Add @FunctionalInterface annotation to several interfaces By adding the `@FunctionalInterface` to `RowMapper`, `StatementPreperator` and `PreparedStatementSetter` it's possible to write a JdbcIO source in a more concise and functional style: ``` pipeline.apply(JdbcIO.<KV<Integer, String>>read() .withQuery("select id,name from Person where name = ?") .withRowMapper(resultSet -> KV.of(resultSet.getInt(1), resultSet.getString(2))) .withStatementPreparator(preparedStatement -> preparedStatement.setString(1, "Darwin")) ); ``` This change is backwards compatible with existing `JdbcIO` sources. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wardva/beam jdbcio-functional-interfaces Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/3934.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3934 ---- commit 31167cf50c4b6c61e45f149f2f42efb8e22355e8 Author: Ward Van Assche <w...@piesync.com> Date: 2017-10-03T13:13:22Z Add @FunctionalInterface annotation to several interfaces By adding the @FunctionalInterface to RowMapper, StatementPreperator and PreparedStatementSetter it's possible to write a JdbcIO source in a more concise and functional style. This change is backwards compatible with existing JdbcIO sources. ---- ---