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

9
LINES

< > BotCompany Repo | #1026008 // cSmartSet - set fields in Concept object with smart conversions (e.g. string to int)

JavaX fragment (include)

// returns number of changes
static int cSmartSet(Concept c, O... values) ctex {
  if (c == null) ret 0;
  warnIfOddCount(values = expandParams(c.getClass(), values));
  int changes = 0;
  for (int i = 0; i+1 < l(values); i += 2)
    if (_cSmartSetField(c, (S) values[i], values[i+1])) ++changes;
  ret changes;
}

Author comment

Began life as a copy of #1009257

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1026008
Snippet name: cSmartSet - set fields in Concept object with smart conversions (e.g. string to int)
Eternal ID of this version: #1026008/1
Text MD5: 73a3529202e5c086151551a67998e602
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-07 13:42:27
Source code size: 321 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 206 / 261
Referenced in: [show references]