1 | sO getFirstNonNullField(O o, S... fields) { |
2 | for unnull (S field : fields) |
3 | try object getOpt(o, field); |
4 | null; |
5 | } |
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: | 275 / 305 |
Referenced in: | [show references] |