Payments.

Co-authored-by: Alan Evans <alan@signal.org>
Co-authored-by: Alex Hart <alex@signal.org>
Co-authored-by: Cody Henthorne <cody@signal.org>
This commit is contained in:
Android Team
2021-04-06 13:03:33 -03:00
committed by Alan Evans
parent c42023855b
commit fddba2906a
311 changed files with 18956 additions and 235 deletions

View File

@@ -0,0 +1,23 @@
package org.signal.core.util;
import android.os.Build;
import androidx.annotation.NonNull;
import java.util.Map;
public final class MapUtil {
private MapUtil() {}
@NonNull
public static <K, V> V getOrDefault(@NonNull Map<K, V> map, @NonNull K key, @NonNull V defaultValue) {
if (Build.VERSION.SDK_INT >= 24) {
//noinspection ConstantConditions
return map.getOrDefault(key, defaultValue);
} else {
V v = map.get(key);
return v == null ? defaultValue : v;
}
}
}