public class U extends Object
| Constructor and Description |
|---|
U() |
| Modifier and Type | Method and Description |
|---|---|
static void |
argMust(boolean expectedCondition,
String message,
Object... args) |
static Object[] |
array(Iterable<?> items) |
static <T> T[] |
array(T... items) |
static <K,V> Map<K,V> |
autoExpandingMap(Class<?> clazz) |
static <K,V> Map<K,V> |
autoExpandingMap(Mapper<K,V> valueFactory) |
static void |
bounds(int value,
int min,
int max) |
static String |
bytesAsText(byte[] bytes) |
static RuntimeException |
cancelled() |
static String |
capitalized(String s) |
static <T> T |
cast(Object value) |
static <T> int |
compare(T val1,
T val2) |
static CompiledScript |
compileJS(String js) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap() |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(K key,
V value) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(K key1,
V value1,
K key2,
V value2) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4,
K key5,
V value5) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(Map<? extends K,? extends V> src,
boolean ignoreNullValues) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap(Object... keysAndValues) |
static String |
copyNtimes(String s,
int n) |
static <T> T |
dynamic(Class<T> targetInterface,
Dynamic dynamic) |
static boolean |
eq(Object a,
Object b) |
static <T> T |
evalJS(String js) |
static <T> T |
evalJS(String js,
Map<String,?> bindings) |
static String |
format(String s,
Object... args) |
static IllegalArgumentException |
illegalArg(String message,
Object... args) |
static String |
insert(String target,
int atIndex,
String insertion) |
static boolean |
isEmpty(Collection<?> coll) |
static boolean |
isEmpty(Iterable<?> iter) |
static boolean |
isEmpty(Map<?,?> map) |
static boolean |
isEmpty(Object value) |
static boolean |
isEmpty(Object[] arr) |
static boolean |
isEmpty(String value) |
static <T> Iterator<T> |
iterator(T[] arr) |
static String |
join(String sep,
char[][] items) |
static String |
join(String sep,
Iterable<?> items) |
static <T> String |
join(String sep,
T... items) |
static int |
limited(int min,
int value,
int max) |
static <T> List<T> |
list() |
static <T> List<T> |
list(Iterable<? extends T> values) |
static <T> List<T> |
list(T... values) |
static <K,V> Map<K,V> |
map() |
static <K,V> Map<K,V> |
map(K key,
V value) |
static <K,V> Map<K,V> |
map(K key1,
V value1,
K key2,
V value2) |
static <K,V> Map<K,V> |
map(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> Map<K,V> |
map(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> Map<K,V> |
map(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4,
K key5,
V value5) |
static <K,V> Map<K,V> |
map(Map<? extends K,? extends V> src) |
static <K,V> Map<K,V> |
map(Object... keysAndValues) |
static <K,V> Map<K,List<V>> |
mapOfLists() |
static <K1,K2,V> Map<K1,Map<K2,V>> |
mapOfMaps() |
static <K,V> Map<K,Set<V>> |
mapOfSets() |
static String |
mid(String s,
int beginIndex,
int endIndex) |
static boolean |
must(boolean expectedCondition) |
static boolean |
must(boolean expectedCondition,
String message) |
static boolean |
must(boolean expectedCondition,
String message,
long arg) |
static boolean |
must(boolean expectedCondition,
String message,
Object arg) |
static boolean |
must(boolean expectedCondition,
String message,
Object arg1,
Object arg2) |
static boolean |
must(boolean expectedCondition,
String message,
Object arg1,
Object arg2,
Object arg3) |
static String |
nice(String format,
Object... args) |
static RuntimeException |
notExpected() |
static <T> T |
notNull(T value,
String msgOrDesc,
Object... descArgs) |
static void |
notNullAll(Object... items) |
static RuntimeException |
notReady() |
static RuntimeException |
notSupported() |
static int |
num(String s) |
static <T> T |
or(T value,
T fallback) |
static <K,V> Map<K,V> |
orderedMap() |
static <K,V> Map<K,V> |
orderedMap(K key,
V value) |
static <K,V> Map<K,V> |
orderedMap(K key1,
V value1,
K key2,
V value2) |
static <K,V> Map<K,V> |
orderedMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> Map<K,V> |
orderedMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> Map<K,V> |
orderedMap(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4,
K key5,
V value5) |
static <K,V> Map<K,V> |
orderedMap(Map<? extends K,? extends V> src,
boolean ignoreNullValues) |
static <K,V> Map<K,V> |
orderedMap(Object... keysAndValues) |
static <T> List<T> |
page(Iterable<T> items,
int page,
int pageSize) |
static void |
print(Object... values) |
static <T> Queue<T> |
queue() |
static <T> BlockingQueue<T> |
queue(int maxSize) |
static <T> List<T> |
range(Iterable<T> items,
int fromIndex,
int toIndex) |
static String |
readable(Iterable<Object> coll) |
static String |
readable(Iterator<?> it) |
static String |
readable(Object obj) |
static String |
readable(Object[] objs) |
static String |
readableln(Object[] objs) |
static String |
render(Iterable<?> items,
String itemFormat,
String sep) |
static String |
render(Object[] items,
String itemFormat,
String sep) |
static String |
replaceText(String s,
String[][] repls) |
static RuntimeException |
rte(String message) |
static RuntimeException |
rte(String message,
Object... args) |
static RuntimeException |
rte(String message,
Throwable cause) |
static RuntimeException |
rte(String message,
Throwable cause,
Object... args) |
static RuntimeException |
rte(Throwable cause) |
static void |
rteIf(boolean failureCondition,
String msg) |
static <T> List<T> |
safe(List<T> list) |
static <K,V> Map<K,V> |
safe(Map<K,V> list) |
static Object[] |
safe(Object[] arr) |
static <T> Set<T> |
safe(Set<T> list) |
static String |
safe(String s) |
static void |
secure(boolean condition,
String msg) |
static void |
secure(boolean condition,
String msg,
Object arg) |
static void |
secure(boolean condition,
String msg,
Object arg1,
Object arg2) |
static <T> Set<T> |
set() |
static <T> Set<T> |
set(Iterable<? extends T> values) |
static <T> Set<T> |
set(T... values) |
static <T> T |
single(Iterable<T> coll) |
static <T> T |
singleOrNone(Iterable<T> coll) |
static void |
sleep(long millis)
Sleeps (calling Thread.sleep) for the specified period.
|
static <T> List<T> |
synchronizedList() |
static <K,V> Map<K,V> |
synchronizedMap() |
static <T> Set<T> |
synchronizedSet() |
static long |
time() |
static String |
triml(String s,
char prefix) |
static String |
triml(String s,
String prefix) |
static String |
trimr(String s,
char suffix) |
static String |
trimr(String s,
String suffix) |
static String |
uncapitalized(String s) |
static void |
wait(CountDownLatch latch) |
static void |
wait(CountDownLatch latch,
long timeout,
TimeUnit unit) |
static boolean |
xor(boolean a,
boolean b) |
public static void print(Object... values)
public static <T> Iterator<T> iterator(T[] arr)
public static <T> T[] array(T... items)
public static <T> Set<T> synchronizedSet()
public static <T> Set<T> set()
public static <T> Set<T> set(T... values)
public static <T> List<T> synchronizedList()
public static <T> List<T> list()
public static <T> List<T> list(T... values)
public static <K,V> Map<K,V> map()
public static <K,V> Map<K,V> map(K key, V value)
public static <K,V> Map<K,V> map(K key1, V value1, K key2, V value2)
public static <K,V> Map<K,V> map(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> Map<K,V> map(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <K,V> Map<K,V> map(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
public static <K,V> ConcurrentMap<K,V> concurrentMap()
public static <K,V> ConcurrentMap<K,V> concurrentMap(Map<? extends K,? extends V> src, boolean ignoreNullValues)
public static <K,V> ConcurrentMap<K,V> concurrentMap(K key, V value)
public static <K,V> ConcurrentMap<K,V> concurrentMap(K key1, V value1, K key2, V value2)
public static <K,V> ConcurrentMap<K,V> concurrentMap(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> ConcurrentMap<K,V> concurrentMap(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <K,V> ConcurrentMap<K,V> concurrentMap(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
public static <K,V> ConcurrentMap<K,V> concurrentMap(Object... keysAndValues)
public static <K,V> Map<K,V> orderedMap()
public static <K,V> Map<K,V> orderedMap(Map<? extends K,? extends V> src, boolean ignoreNullValues)
public static <K,V> Map<K,V> orderedMap(K key, V value)
public static <K,V> Map<K,V> orderedMap(K key1, V value1, K key2, V value2)
public static <K,V> Map<K,V> orderedMap(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> Map<K,V> orderedMap(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <K,V> Map<K,V> orderedMap(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
public static <K,V> Map<K,V> synchronizedMap()
public static <T> Queue<T> queue()
public static <T> BlockingQueue<T> queue(int maxSize)
public static <T> T or(T value,
T fallback)
public static long time()
public static boolean xor(boolean a,
boolean b)
public static RuntimeException rte(String message)
public static RuntimeException rte(String message, Throwable cause)
public static RuntimeException rte(Throwable cause)
public static RuntimeException rte(String message, Object... args)
public static RuntimeException cancelled()
public static RuntimeException notExpected()
public static void rteIf(boolean failureCondition,
String msg)
public static boolean must(boolean expectedCondition,
String message)
public static RuntimeException rte(String message, Throwable cause, Object... args)
public static boolean must(boolean expectedCondition)
public static boolean must(boolean expectedCondition,
String message,
long arg)
public static boolean must(boolean expectedCondition,
String message,
Object arg1,
Object arg2)
public static boolean must(boolean expectedCondition,
String message,
Object arg1,
Object arg2,
Object arg3)
public static IllegalArgumentException illegalArg(String message, Object... args)
public static void secure(boolean condition,
String msg)
public static void bounds(int value,
int min,
int max)
public static void notNullAll(Object... items)
public static RuntimeException notReady()
public static RuntimeException notSupported()
public static boolean isEmpty(String value)
public static boolean isEmpty(Object[] arr)
public static boolean isEmpty(Collection<?> coll)
public static boolean isEmpty(Iterable<?> iter)
public static boolean isEmpty(Map<?,?> map)
public static boolean isEmpty(Object value)
public static int num(String s)
public static int limited(int min,
int value,
int max)
public static <T> T single(Iterable<T> coll)
public static <T> T singleOrNone(Iterable<T> coll)
public static <T> int compare(T val1,
T val2)
public static String bytesAsText(byte[] bytes)
public static void sleep(long millis)
CancellationException to propagate the interruption.millis - the length of time to sleep in milliseconds.public static <T> T cast(Object value)
public static void wait(CountDownLatch latch)
public static void wait(CountDownLatch latch, long timeout, TimeUnit unit)
public static <T> T evalJS(String js) throws ScriptException
ScriptExceptionpublic static <T> T evalJS(String js, Map<String,?> bindings) throws ScriptException
ScriptExceptionpublic static CompiledScript compileJS(String js) throws ScriptException
ScriptExceptionCopyright © 2014–2015 Nikolche Mihajlovski and contributors. All rights reserved.