Last active
September 20, 2016 22:30
-
-
Save nwillc/3f799c7ee65b9c36143e630702112dd6 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 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