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

15
LINES

< > BotCompany Repo | #1012288 // setOptAll_pcall

JavaX fragment (include)

static void setOptAll_pcall(O o, Map<S, O> fields) {
  if (fields == null) ret;
  for (S field : keys(fields))
    pcall-short { setOpt(o, field, fields.get(field)); }
}

static void setOptAll_pcall(O o, O... values) {
  //values = expandParams(c.getClass(), values);
  warnIfOddCount(values);
  for (int i = 0; i+1 < l(values); i += 2) {
    S field = (S) values[i];
    O value = values[i+1];
    pcall-short { setOpt(o, field, value); }
  }
}

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: 294 / 351
Referenced in: [show references]