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

17
LINES

< > BotCompany Repo | #1008841 - setAll - returns the object

JavaX fragment (include)

1  
static <A> A setAll(A o, Map<S, O> fields) {
2  
  if (fields == null) ret o;
3  
  for (S field : keys(fields))
4  
    set(o, field, fields.get(field));
5  
  ret o;
6  
}
7  
8  
static <A> A setAll(A o, O... values) {
9  
  //values = expandParams(c.getClass(), values);
10  
  failIfOddCount(values);
11  
  for (int i = 0; i+1 < l(values); i += 2) {
12  
    S field = (S) values[i];
13  
    O value = values[i+1];
14  
    set(o, field, value);
15  
  }
16  
  ret o;
17  
}

Author comment

Began life as a copy of #1004782

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1008841
Snippet name: setAll - returns the object
Eternal ID of this version: #1008841/4
Text MD5: e5bfb2414e6c8c3f84dafddc32504861
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-09 11:06:49
Source code size: 427 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 279 / 335
Version history: 3 change(s)
Referenced in: [show references]