Add mention detection to search flows.

This commit is contained in:
Cody Henthorne
2020-08-07 15:18:40 -04:00
committed by GitHub
parent 5cd4b82ed0
commit d563de4207
7 changed files with 323 additions and 56 deletions

View File

@@ -155,10 +155,14 @@ public class Util {
return value == null || value.getText() == null || TextUtils.isEmpty(value.getTextTrimmed());
}
public static boolean isEmpty(Collection collection) {
public static boolean isEmpty(Collection<?> collection) {
return collection == null || collection.isEmpty();
}
public static boolean hasItems(@Nullable Collection<?> collection) {
return collection != null && !collection.isEmpty();
}
public static <K, V> V getOrDefault(@NonNull Map<K, V> map, K key, V defaultValue) {
return map.containsKey(key) ? map.get(key) : defaultValue;
}