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