Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1029148 - proxy_importResults - proxy + quickImport method results

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2823L/18K).

static <A> A nuLike proxy_importResults(Class<A> intrface, final O target) {
  if (target == null) null;
  if (isInstance(intrface, target)) ret (A) target;
  ret (A) java.lang.reflect.Proxy.newProxyInstance(intrface.getClassLoader(),
   new Class[] { intrface },
   new InvocationHandler {
     public O invoke(O proxy, Method method, O[] args) {
       ret quickImport(call(target, method.getName(), unnull(args)));
     }
   });
}

static <A> A proxy_importResults(O target, Class<A> intrface) {
  ret proxy_importResults(intrface, target);
}

Author comment

Began life as a copy of #1003492

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029148
Snippet name: proxy_importResults - proxy + quickImport method results
Eternal ID of this version: #1029148/1
Text MD5: b87c2c3e4106e32ead4eb03399cebb75
Transpilation MD5: d1ae9320950dabb72d463c23f1aac666
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-22 01:09:55
Source code size: 559 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 33 / 60
Referenced in: [show references]

Formerly at http://tinybrain.de/1029148 & http://1029148.tinybrain.de