MessageBox

This commit is contained in:
huangyuhui
2018-01-09 21:37:04 +08:00
parent 9e21e02791
commit 8edfe7bc9c
31 changed files with 817 additions and 415 deletions

View File

@@ -194,7 +194,7 @@ public abstract class Task {
executor().start();
}
public final boolean test() throws Exception {
public final boolean test() {
return executor().test();
}

View File

@@ -182,6 +182,13 @@ public final class Lang {
return (V) o;
}
public static <V> Optional<V> get(List<V> list, int index) {
if (index < 0 || index >= list.size())
return Optional.empty();
else
return Optional.ofNullable(list.get(index));
}
public static <V> Optional<V> get(Map<?, ?> map, Object key, Class<V> clazz) {
return convert(map.get(key), clazz);
}
@@ -248,4 +255,9 @@ public final class Lang {
return defaultValue;
}
}
public static <T> T nonNull(T... t) {
for (T a : t) if (a != null) return a;
return null;
}
}