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

14
LINES

< > BotCompany Repo | #1031534 // cSmartSet_withConverter_pcall - set fields in Concept object with converter

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (15857L/102K).

1  
static int cSmartSet_withConverter_pcall(bool verbose default false, Concept c, O... values) {
2  
  ret cSmartSet_withConverter_pcall(verbose, new DefaultValueConverterForField, c, values);
3  
}
4  
5  
// returns number of changes
6  
static int cSmartSet_withConverter_pcall(bool verbose default false, ValueConverterForField converter, Concept c, O... values) ctex {
7  
  if (c == null) ret 0;
8  
  warnIfOddCount(values = unrollAndExpandParams(c.getClass(), values));
9  
  int changes = 0;
10  
  for (int i = 0; i+1 < l(values); i += 2) pcall {
11  
    if (cSmartSetField_withConverter(c, (S) values[i], values[i+1], converter, verbose)) ++changes;
12  
  }
13  
  ret changes;
14  
}

Author comment

Began life as a copy of #1029595

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031534
Snippet name: cSmartSet_withConverter_pcall - set fields in Concept object with converter
Eternal ID of this version: #1031534/5
Text MD5: dc11eaaa1cad726e7b7a6fb92836b269
Transpilation MD5: b77beb6513d1b73f738441f21b3e3dd3
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-22 09:53:18
Source code size: 652 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 191 / 247
Version history: 4 change(s)
Referenced in: [show references]