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

13
LINES

< > BotCompany Repo | #1031815 // ccopyFields_withConverter_pcall - for concepts

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

Libraryless. Click here for Pure Java version (17222L/106K).

static <A extends Concept> A ccopyFields_withConverter_pcall(Concept x, A y, S... fields) {
  if (x == null || y == null) ret y;
  if (empty(fields)) { // assume we should copy all fields
    for (S field : conceptFields(x))
      pcall cSmartSetField_withConverter(y, field, cget(x, field));
  } else 
    for (S field : fields) {
      O o = cget(x, field);
      if (o != null)
        pcall cSmartSetField_withConverter(y, field, o);
    }
  ret y;
}

Author comment

Began life as a copy of #1031344

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031815
Snippet name: ccopyFields_withConverter_pcall - for concepts
Eternal ID of this version: #1031815/3
Text MD5: a89d06835f3f52cbffc00108a4eb7e37
Transpilation MD5: 6afad4b209a404595f2b54ea24fb7b07
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-02 20:55:40
Source code size: 466 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 139 / 197
Version history: 2 change(s)
Referenced in: [show references]