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

17
LINES

< > BotCompany Repo | #1005268 - setOptAllDyn

JavaX fragment (include)

1  
static void setOptAllDyn(DynamicObject o, Map<S, O> fields) {
2  
  if (fields == null) ret;
3  
  HashMap<S, Field> fieldMap = instanceFieldsMap(o);
4  
  for (Map.Entry<S, O> e : fields.entrySet()) {
5  
    S field = e.getKey();
6  
    O val = e.getValue();
7  
    bool has = fieldMap.containsKey(field);
8  
    if (has)
9  
      setOpt(o, field, val);
10  
    else {
11  
      o.fieldValues = syncMapPut2_createLinkedHashMap(o.fieldValues, intern(field), val);
12  
      ifdef setOptAllDyn_debug
13  
        print("setOptAllDyn added dyn " + field + " to " + o + " [value: " + val + ", fieldValues = " + systemHashCode(o.fieldValues) + ", " + struct(keys(o.fieldValues)) + "]");
14  
      endifdef
15  
    }
16  
  }
17  
}

Author comment

Began life as a copy of #1004782

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1005268
Snippet name: setOptAllDyn
Eternal ID of this version: #1005268/10
Text MD5: cbdefefabbdbaebbb52bb38ceb0948be
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-13 14:43:12
Source code size: 681 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 313
Version history: 9 change(s)
Referenced in: [show references]