Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created September 20, 2016 22:30
Show Gist options
  • Save nwillc/8c24a20b7cb0291545b7965e15f263b7 to your computer and use it in GitHub Desktop.
Save nwillc/8c24a20b7cb0291545b7965e15f263b7 to your computer and use it in GitHub Desktop.
class Example {
final static BiFunction<ResultSet, Integer, String> STRING =
(r, index) -> {
try {
return r.getString(index);
} catch (SQLException e) {
throw new RuntimeException(e);
}
};
void example() {
Bean bean = new Bean();
Extractor<Bean> extractor = new ExtractorFactory<>()
.factory(Bean::new)
.add(Bean::setStr, STRING, 1)
.getExtractor();
}
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