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.

// We even allow overriding existing interface implementations
static <A> A nuLike lookupDynamicInterface_v2(Class<A> intrface, O o) {
  O implementation = metaGet(o, intrface);
  if (isInstance(intrface, implementation)) ret (A) implementation;
  if (isInstance(intrface, o)) ret (A) o;
  null;
}


static <A> A nuLike lookupDynamicInterface_v2(O o, Class<A> intrface) {
  ret lookupDynamicInterface_v2(intrface, o);
}

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: 126 / 180
Version history: 1 change(s)
Referenced in: [show references]