Libraryless. Click here for Pure Java version (2894L/17K).
1 | static AutoCloseable combineAutoCloseables(final AutoCloseable a, final AutoCloseable b) { |
2 | ret a == null ? b : b == null ? a : autocloseable { pClose(a); pClose(b); }; |
3 | } |
4 | |
5 | static AutoCloseable combineAutoCloseables(AutoCloseable a, AutoCloseable b, AutoCloseable c, AutoCloseable... more) { |
6 | ret combineAutoCloseables(concatLists(ll(a, b, c), asList(more))); |
7 | } |
8 | |
9 | static AutoCloseable combineAutoCloseables(Iterable<AutoCloseable> l) { |
10 | ret foldl(func(AutoCloseable a, AutoCloseable b) -> AutoCloseable { combineAutoCloseables(a,b) }, null, l); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016422 |
Snippet name: | combineAutoCloseables - closes a first, then b |
Eternal ID of this version: | #1016422/8 |
Text MD5: | c6816be79a2ed5ea57acf0598de6cf8d |
Transpilation MD5: | 8cbb2565368e24cca6893680d8f0db45 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-24 22:36:44 |
Source code size: | 557 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 617 / 737 |
Version history: | 7 change(s) |
Referenced in: | [show references] |