1 | static <A> A optPar(ThreadLocal<A> tl, A defaultValue) { |
2 | A a = tl.get(); |
3 | if (a != null) { |
4 | tl.set(null); |
5 | ret a; |
6 | } |
7 | ret defaultValue; |
8 | } |
9 | |
10 | static <A> A optPar(ThreadLocal<A> tl) { |
11 | ret optPar(tl, null); |
12 | } |
13 | |
14 | sO optPar(O[] params, S name) { |
15 | ret optParam(params, name); |
16 | } |
17 | |
18 | sO mapMethodLike optPar(S name, O[] params) { |
19 | ret optParam(params, name); |
20 | } |
21 | |
22 | sO mapMethodLike optPar(S name, Map params) { |
23 | ret optParam(name, params); |
24 | } |
25 | |
26 | static <A> A optPar(O[] params, S name, A defaultValue) { |
27 | ret optParam(params, name, defaultValue); |
28 | } |
29 | |
30 | static <A> A optPar(S name, O[] params, A defaultValue) { |
31 | ret optParam(params, name, defaultValue); |
32 | } |
Began life as a copy of #1006091
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: | #1006679 |
Snippet name: | optPar - get optional parameter from ThreadLocal or params |
Eternal ID of this version: | #1006679/11 |
Text MD5: | 44bfbca0f635f56d74114ba020aa40ee |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-16 18:38:22 |
Source code size: | 680 bytes / 32 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 732 / 771 |
Version history: | 10 change(s) |
Referenced in: | [show references] |