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

5
LINES

< > BotCompany Repo | #1023496 // getFirstNonNullField - try multiple fields, return first value != null

JavaX fragment (include)

sO getFirstNonNullField(O o, S... fields) {
  for unnull (S field : fields)
    try object getOpt(o, field);
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, omdjrrnzbjjv, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1023496
Snippet name: getFirstNonNullField - try multiple fields, return first value != null
Eternal ID of this version: #1023496/1
Text MD5: 0eebeaf90814a9857319b8b41c670b74
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-25 18:44:04
Source code size: 122 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 274 / 304
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)