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

10
LINES

< > BotCompany Repo | #1021644 // multiMapFromKeyAndValueField

JavaX fragment (include)

static <A, B> MultiMap<A, B> multiMapFromKeyAndValueField(Collection l, S keyField, S valueField) {
  new MultiMap<A, B> mm;
  if (l != null) for (O o : l)
    mm.put((A) getOpt(o, keyField), (B) getOpt(o, valueField));
  ret mm;
}

static <A, B> MultiMap<A, B> multiMapFromKeyAndValueField(S keyField, S valueField, Collection l) {
  ret multiMapFromKeyAndValueField(l, keyField, valueField);
}

Author comment

Began life as a copy of #1020017

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021644
Snippet name: multiMapFromKeyAndValueField
Eternal ID of this version: #1021644/5
Text MD5: 0a451c398a2e24cdf193f56b909c456a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-23 10:19:41
Source code size: 404 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 179 / 201
Version history: 4 change(s)
Referenced in: [show references]