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

20
LINES

< > BotCompany Repo | #1009257 // cset - set fields in Concept object (with notification of DB)

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

Libraryless. Click here for Pure Java version (13189L/90K).

1  
// returns number of changes
2  
static int cset(Concept c, O... values) ctex {
3  
  if (c == null) ret 0;
4  
  warnIfOddCount(values = expandParams(c.getClass(), values));
5  
  int changes = 0;
6  
  for (int i = 0; i+1 < l(values); i += 2)
7  
    if (_csetField(c, (S) values[i], values[i+1])) ++changes;
8  
  ret changes;
9  
}
10  
11  
static int cset(Iterable<? extends Concept> l, O... values) {
12  
  int changes = 0;
13  
  fOr (Concept c : l)
14  
    changes += cset(c, values);
15  
  ret changes;
16  
}
17  
18  
static <A extends Concept> int cset(Concept.Ref<A> c, O... values) {
19  
  ret cset(getVar(c), values);
20  
}

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: #1009257
Snippet name: cset - set fields in Concept object (with notification of DB)
Eternal ID of this version: #1009257/16
Text MD5: 67fad25d4a8013de46edd7db2a76eedc
Transpilation MD5: a6a1cbfe143d5ec72245be87acf531d1
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-07 22:59:23
Source code size: 578 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 741 / 925
Version history: 15 change(s)
Referenced in: [show references]