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

12
LINES

< > BotCompany Repo | #1036172 // lookupDynamicInterface_v2

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

Transpiled version (9207L) is out of date.

1  
// We even allow overriding existing interface implementations
2  
static <A> A nuLike lookupDynamicInterface_v2(Class<A> intrface, O o) {
3  
  O implementation = metaGet(o, intrface);
4  
  if (isInstance(intrface, implementation)) ret (A) implementation;
5  
  if (isInstance(intrface, o)) ret (A) o;
6  
  null;
7  
}
8  
9  
10  
static <A> A nuLike lookupDynamicInterface_v2(O o, Class<A> intrface) {
11  
  ret lookupDynamicInterface_v2(intrface, o);
12  
}

Author comment

Began life as a copy of #1031190

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036172
Snippet name: lookupDynamicInterface_v2
Eternal ID of this version: #1036172/2
Text MD5: 3d92eb35538449e0e5921f5aa695e32c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-04 18:48:06
Source code size: 430 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 127 / 183
Version history: 1 change(s)
Referenced in: [show references]