Libraryless. Click here for Pure Java version (2519L/16K).
1 | static <A> A nuLike proxy(Class<A> intrface, final O target) { |
2 | if (target == null) null; |
3 | if (isInstance(intrface, target)) ret (A) target; |
4 | ret (A) java.lang.reflect.Proxy.newProxyInstance(intrface.getClassLoader(), |
5 | new Class[] { intrface }, |
6 | new proxy_InvocationHandler(target)); |
7 | } |
8 | |
9 | static <A> A proxy(O target, Class<A> intrface) { |
10 | ret proxy(intrface, target); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1003492 |
Snippet name: | proxy - make an implementation of an interface forwarding calls to any object |
Eternal ID of this version: | #1003492/8 |
Text MD5: | 8887fc429e261ebae5a2788b34dae905 |
Transpilation MD5: | fe21239f8f154d3eb65eae5f3e708932 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-09-23 11:24:41 |
Source code size: | 388 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 702 / 823 |
Version history: | 7 change(s) |
Referenced in: | [show references] |