Skip to content

Instantly share code, notes, and snippets.

@nwillc
Last active September 20, 2016 22:30
Show Gist options
  • Save nwillc/3f799c7ee65b9c36143e630702112dd6 to your computer and use it in GitHub Desktop.
Save nwillc/3f799c7ee65b9c36143e630702112dd6 to your computer and use it in GitHub Desktop.
class Example1 {
final static BiFunction<ResultSet, Integer, String> STRING =
(r, index) -> {
try {
return r.getString(index);
} catch (SQLException e) {
throw new RuntimeException(e);
}
};
void example(ResultSet rs, Integer i) {
Bean bean = new Bean();
copy(bean, Bean::setStr, rs, STRING, i);
}
class Bean {
String str;
void setStr(String str) {
this.str = str;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment