Delegates to Map#get. Returns null on ClassCastException and NullPointerException.
(Map<?, V> map, @Nullable Object key)
| 3521 | |
| 3522 | |
| 3523 | static <V> V safeGet(Map<?, V> map, @Nullable Object key) { |
| 3524 | checkNotNull(map); |
| 3525 | try { |
| 3526 | return map.get(key); |
| 3527 | } catch (ClassCastException e) { |
| 3528 | return null; |
| 3529 | } catch (NullPointerException e) { |
| 3530 | return null; |
| 3531 | } |
| 3532 | } |
| 3533 | |
| 3534 | /** |
| 3535 | * Delegates to {@link Map#containsKey}. Returns {@code false} on {@code |