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

15
LINES

< > BotCompany Repo | #1012288 // setOptAll_pcall

JavaX fragment (include)

1  
static void setOptAll_pcall(O o, Map<S, O> fields) {
2  
  if (fields == null) ret;
3  
  for (S field : keys(fields))
4  
    pcall-short { setOpt(o, field, fields.get(field)); }
5  
}
6  
7  
static void setOptAll_pcall(O o, O... values) {
8  
  //values = expandParams(c.getClass(), values);
9  
  warnIfOddCount(values);
10  
  for (int i = 0; i+1 < l(values); i += 2) {
11  
    S field = (S) values[i];
12  
    O value = values[i+1];
13  
    pcall-short { setOpt(o, field, value); }
14  
  }
15  
}

Author comment

Began life as a copy of #1004782

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: #1012288
Snippet name: setOptAll_pcall
Eternal ID of this version: #1012288/1
Text MD5: d039c42ddf17fc5ca39d4901f8874044
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-27 11:47:39
Source code size: 459 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 373 / 434
Referenced in: [show references]