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

11
LINES

< > BotCompany Repo | #1017186 // addAndReturnIfNotNull

JavaX fragment (include)

static <A> A addAndReturnIfNotNull(Collection<A> l, A a) {
  if (a != null && l != null) l.add(a);
  ret a;
}

ifclass MultiSet
static <A> A addAndReturnIfNotNull(MultiSet<A> ms, A a) {
  if (a != null && ms != null) ms.add(a);
  ret a;
}
endif

Author comment

Began life as a copy of #1005547

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017186
Snippet name: addAndReturnIfNotNull
Eternal ID of this version: #1017186/1
Text MD5: ba892ae9fb078978727fda3b45cf21e5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-13 18:02:49
Source code size: 254 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 325
Referenced in: [show references]