mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Add username education screen.
This commit is contained in:
committed by
Greyson Parrelli
parent
dae69744c2
commit
4f387cf8d9
@@ -5,6 +5,7 @@ import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
public final class MapUtil {
|
||||
|
||||
@@ -20,4 +21,10 @@ public final class MapUtil {
|
||||
return v == null ? defaultValue : v;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static <K, V, M> M mapOrDefault(@NonNull Map<K, V> map, @NonNull K key, @NonNull Function<V, M> mapper, @NonNull M defaultValue) {
|
||||
V v = map.get(key);
|
||||
return v == null ? defaultValue : mapper.apply(v);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user