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

13
LINES

< > BotCompany Repo | #1010948 // callAllMethodsInInterface ["interface" can be a class too]

JavaX fragment (include)

1  
static Map<S, O> callAllMethodsInInterface(O o, Class intrface) {
2  
  new TreeMap<S, O> map;
3  
  for (Method m : intrface.getDeclaredMethods()) {
4  
    if (!empty(m.getParameterTypes())) continue;
5  
    S name = m.getName();
6  
    try {
7  
      map.put(name, call(o, name));
8  
    } catch e {
9  
      map.put(name, e);
10  
    }
11  
  }
12  
  ret map;
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010948
Snippet name: callAllMethodsInInterface ["interface" can be a class too]
Eternal ID of this version: #1010948/2
Text MD5: 3f524af52e95550275199afce64ca881
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-05 01:01:02
Source code size: 337 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 331 / 375
Version history: 1 change(s)
Referenced in: [show references]