Libraryless. Click here for Pure Java version (2247L/14K).
static <A> A singleObjectMethodProxy(Class<A> intrface, O object, S methodName) { ret proxyFromInvocationHandler(intrface, new InvocationHandler { public O invoke(O proxy, Method method, O[] args) { S mname = method.getName(); ifdef singleObjectMethodProxy_debug print("Proxy method called: " + mname + " " + toList(args)); endifdef if (mname.equals(methodName)) ret call(object, methodName, unnull(args)); if (mname.equals("toString")) ret "proxy for " + methodName; null; } }); }
Began life as a copy of #1027669
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027670 |
| Snippet name: | singleObjectMethodProxy |
| Eternal ID of this version: | #1027670/5 |
| Text MD5: | 874570ed448cd942112ca26463ae657b |
| Transpilation MD5: | 29746395eece4ddeafe524ce72c2acdd |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-03-29 23:36:31 |
| Source code size: | 567 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 425 / 564 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |