Created
September 20, 2016 22:30
-
-
Save nwillc/8c24a20b7cb0291545b7965e15f263b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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