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

3
LINES

< > BotCompany Repo | #1034875 // containsKeyPredicate - .containsKey() as a predicate. null map will return always-false predicate

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5059L/28K).

static <A, B> IPred<A> containsKeyPredicate(Map<A, B> map) {
  ret map == null ? a -> false : a -> map.containsKey(a);
}

Author comment

Began life as a copy of #1034874

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034875
Snippet name: containsKeyPredicate - .containsKey() as a predicate. null map will return always-false predicate
Eternal ID of this version: #1034875/2
Text MD5: d946b181c824b04b0dada21268b695b1
Transpilation MD5: 33f10f96eba25644984d4e88af57cece
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-12 22:42:33
Source code size: 122 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 76 / 127
Version history: 1 change(s)
Referenced in: [show references]