public final class JdkUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> V |
putIfAbsent(Map<K,V> map,
K key,
V value)
Backwards compatible
Map.putIfAbsent(K, V) to support < Android API 24. |
static <T> T |
requireNonNull(T object)
This method mimics the behavior of Objects.requireNonNull method to allow
Android API level 15 backward compatibility.
|
public static <K,V> V putIfAbsent(Map<K,V> map, K key, V value)
Map.putIfAbsent(K, V) to support < Android API 24.
If the specified key is not already associated with a value (or is mapped
to null) associates it with the given value and returns
null, else returns the current value.key - key with which the specified value is to be associatedvalue - value to be associated with the specified keynull if there was no mapping for the key.public static <T> T requireNonNull(T object)
object - NullPointerException - if object is nullCopyright © 2022. All rights reserved.