public class U extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String[] |
ARGS |
static LogLevel |
DEBUG |
static LogLevel |
ERROR |
static LogLevel |
INFO |
protected static LogLevel |
LOG_LEVEL |
protected static Random |
RND |
static LogLevel |
SEVERE |
static LogLevel |
TRACE |
static LogLevel |
WARN |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areAssignable(Class<?>[] types,
Object[] values) |
static void |
args(String... args) |
static <T> T[] |
array(T... items) |
static <K,V> Map<K,V> |
autoExpandingMap(Class<V> clazz) |
static <K,V> Map<K,V> |
autoExpandingMap(Mapper<K,V> valueFactory) |
static void |
benchmark(String name,
int count,
Runnable runnable) |
static void |
benchmarkComplete(String name,
int count,
long startTime) |
static void |
benchmarkMT(int threadsN,
String name,
int count,
CountDownLatch outsideLatch,
Runnable runnable) |
static void |
benchmarkMT(int threadsN,
String name,
int count,
Runnable runnable) |
static ByteBuffer |
buf(String s) |
static String |
buf2str(ByteBuffer buf) |
static String |
bytesToString(byte[] bytes) |
static String |
camelPhrase(String s) |
static String |
camelSplit(String s) |
static String |
capitalized(String s) |
static byte[] |
classBytes(String fullClassName) |
static ClassLoader |
classLoader() |
static void |
classpath(String packageName,
Collection<File> files,
Predicate<File> filter) |
static List<File> |
classpath(String packageName,
Predicate<File> filter) |
static List<Class<?>> |
classpathClasses(String packageName,
String nameRegex,
Predicate<Class<?>> filter,
ClassLoader classLoader) |
static List<Class<?>> |
classpathClassesByName(String simpleName,
Predicate<Class<?>> filter,
ClassLoader classLoader) |
static List<Class<?>> |
classpathClassesBySuffix(String nameSuffix,
Predicate<Class<?>> filter,
ClassLoader classLoader) |
static void |
close(InputStream in,
boolean quiet) |
static void |
close(OutputStream out,
boolean quiet) |
static <K,V> ConcurrentMap<K,V> |
concurrentMap() |
static String |
config(String name) |
static boolean |
contains(Object arrOrColl,
Object value) |
static String |
copyNtimes(String s,
int n) |
static int |
cpus() |
static void |
debug(String msg) |
static void |
debug(String msg,
String key,
Object value) |
static void |
debug(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
debug(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static void |
delete(String filename) |
static void |
endMeasure() |
static void |
endMeasure(String info) |
static boolean |
eq(Object a,
Object b) |
static void |
error(String msg) |
static void |
error(String msg,
String key,
Object value) |
static void |
error(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
error(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static void |
error(String msg,
Throwable error) |
static void |
error(Throwable error) |
static <FROM,TO> TO |
eval(Mapper<FROM,TO> mapper,
FROM src) |
static <T> boolean |
eval(Predicate<T> predicate,
T target) |
static Object |
exclude(Object arrOrColl,
Object item) |
static ByteBuffer |
expand(ByteBuffer buf) |
static ByteBuffer |
expand(ByteBuffer buf,
int newSize) |
static <T> T[] |
expand(T[] arr,
int factor) |
static <T> T[] |
expand(T[] arr,
T item) |
static void |
failIf(boolean failureCondition,
String msg) |
static void |
failIf(boolean failureCondition,
String msg,
Object... args) |
static File |
file(String filename) |
static String |
fillIn(String template,
String placeholder,
String value) |
static String |
format(String s,
Object... args) |
static Class<?> |
getClassIfExists(String className) |
static String |
getCpuMemStats() |
static LogLevel |
getLogLevel() |
static boolean |
hasOption(String name) |
static Object |
hook(String hookName) |
static IllegalArgumentException |
illegalArg(String message) |
static Object |
include(Object arrOrColl,
Object item) |
static void |
info(String msg) |
static void |
info(String msg,
String key,
Object value) |
static void |
info(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
info(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static boolean |
instanceOf(Object obj,
Class<?>... classes) |
static boolean |
isEmpty(String value) |
static boolean |
isJREClass(String canonicalClassName) |
static String |
join(String sep,
char[][] items) |
static String |
join(String sep,
Iterable<?> items) |
static String |
join(String sep,
Object... items) |
static void |
joinThread(Thread thread) |
static <T> List<T> |
list(T... values) |
static String |
load(String filename) |
static byte[] |
loadBytes(InputStream input) |
static byte[] |
loadBytes(String filename) |
static List<String> |
loadLines(String filename) |
static List<String> |
loadLines(String filename,
boolean filterEmpty,
String commentPrefix) |
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 <FROM,TO> Mapper<FROM,TO> |
mapper(Map<FROM,TO> map) |
static String |
md5(byte[] bytes) |
static String |
md5(String data) |
static boolean |
micro() |
static String |
mid(String s,
int beginIndex,
int endIndex) |
static MappedByteBuffer |
mmap(String filename,
FileChannel.MapMode mode) |
static MappedByteBuffer |
mmap(String filename,
FileChannel.MapMode mode,
long position,
long size) |
static String |
mul(String s,
int n) |
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 <T> T |
newInstance(Class<T> clazz) |
static <T> T |
newInstance(Class<T> clazz,
Object... args) |
static RuntimeException |
notExpected() |
static <T> T |
notNull(T value,
String desc,
Object... descArgs) |
static void |
notNullAll(Object... items) |
static RuntimeException |
notReady() |
static RuntimeException |
notSupported() |
static int |
num(String s) |
static double |
option(String name,
double defaultValue) |
static int |
option(String name,
int defaultValue) |
static String |
option(String name,
String defaultValue) |
static long |
optionL(String name,
long defaultValue) |
static <T> T |
or(T value,
T fallback) |
static void |
print(Object value) |
static void |
printAll(Collection<?> collection) |
static boolean |
production() |
static <T> Queue<T> |
queue(int maxSize) |
static String |
render(Iterable<?> items,
String itemFormat,
String sep) |
static String |
render(Object[] items,
String itemFormat,
String sep) |
static String |
replace(String s,
String regex,
Mapper<String[],String> replacer) |
static String |
replaceText(String s,
String[][] repls) |
static URL |
resource(String filename) |
static int |
rnd() |
static int |
rnd(int n) |
static <T> T |
rnd(T[] arr) |
static char |
rndChar() |
static int |
rndExcept(int n,
int except) |
static long |
rndL() |
static String |
rndStr(int length) |
static String |
rndStr(int minLength,
int maxLength) |
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 |
save(String filename,
String content) |
static void |
schedule(Runnable task,
long delay) |
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(T... values) |
static void |
setLogLevel(LogLevel logLevel) |
static void |
setLogOutput(Appendable logOutput) |
static void |
severe(String msg) |
static void |
severe(String msg,
String key,
Object value) |
static void |
severe(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
severe(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static void |
severe(String msg,
Throwable error) |
static void |
show(Object... values) |
static void |
sleep(long millis) |
static void |
startMeasure() |
static <T> T[] |
subarray(T[] arr,
int from,
int to) |
static String |
text(Collection<Object> coll) |
static String |
text(Iterator<?> it) |
static String |
text(Object obj) |
static String |
text(Object[] objs) |
static String |
textln(Object[] objs) |
static long |
time() |
static void |
trace(String msg) |
static void |
trace(String msg,
String key,
Object value) |
static void |
trace(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
trace(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static String |
urlDecode(String value) |
static void |
waitFor(Object obj) |
static boolean |
waitInterruption(long millis) |
static void |
warn(String msg) |
static void |
warn(String msg,
String key,
Object value) |
static void |
warn(String msg,
String key1,
Object value1,
String key2,
Object value2) |
static void |
warn(String msg,
String key1,
Object value1,
String key2,
Object value2,
String key3,
Object value3) |
static void |
warn(String msg,
Throwable error) |
static boolean |
xor(boolean a,
boolean b) |
public static final LogLevel TRACE
public static final LogLevel DEBUG
public static final LogLevel INFO
public static final LogLevel WARN
public static final LogLevel ERROR
public static final LogLevel SEVERE
protected static LogLevel LOG_LEVEL
protected static final Random RND
protected static String[] ARGS
public static void setLogLevel(LogLevel logLevel)
public static LogLevel getLogLevel()
public static void setLogOutput(Appendable logOutput)
public static void trace(String msg)
public static void trace(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static void debug(String msg)
public static void debug(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static void info(String msg)
public static void info(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static void warn(String msg)
public static void warn(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static void error(String msg)
public static void error(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static void error(Throwable error)
public static void severe(String msg)
public static void severe(String msg, String key1, Object value1, String key2, Object value2)
public static void severe(String msg, String key1, Object value1, String key2, Object value2, String key3, Object value3)
public static RuntimeException rte(String message, Object... args)
public static RuntimeException rte(Throwable cause)
public static RuntimeException rte(String message)
public static RuntimeException notExpected()
public static IllegalArgumentException illegalArg(String message)
public static <T> T newInstance(Class<T> clazz)
public static <T> T or(T value,
T fallback)
public static void sleep(long millis)
public static boolean waitInterruption(long millis)
public static void waitFor(Object obj)
public static void joinThread(Thread thread)
public static String text(Collection<Object> coll)
public static <T> T[] array(T... items)
public static <T> Set<T> set(T... values)
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> ConcurrentMap<K,V> concurrentMap()
public static <T> Queue<T> queue(int maxSize)
public static ClassLoader classLoader()
public static long time()
public static boolean xor(boolean a,
boolean b)
public static void failIf(boolean failureCondition,
String msg)
public static byte[] loadBytes(InputStream input)
public static byte[] loadBytes(String filename)
public static byte[] classBytes(String fullClassName)
public static List<String> loadLines(String filename, boolean filterEmpty, String commentPrefix)
public static void close(OutputStream out, boolean quiet)
public static void close(InputStream in, boolean quiet)
public static void delete(String filename)
public static <T> T[] expand(T[] arr,
int factor)
public static <T> T[] expand(T[] arr,
T item)
public static <T> T[] subarray(T[] arr,
int from,
int to)
public static boolean must(boolean expectedCondition,
String message)
public static RuntimeException rte(String message, Throwable cause, Object... args)
public static RuntimeException rte(String message, Throwable cause)
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 void notNullAll(Object... items)
public static RuntimeException notReady()
public static RuntimeException notSupported()
public static void show(Object... values)
public static void schedule(Runnable task, long delay)
public static void startMeasure()
public static void endMeasure()
public static void endMeasure(String info)
public static void print(Object value)
public static void printAll(Collection<?> collection)
public static boolean hasOption(String name)
public static int option(String name, int defaultValue)
public static long optionL(String name, long defaultValue)
public static double option(String name, double defaultValue)
public static int cpus()
public static boolean micro()
public static boolean isEmpty(String value)
public static int num(String s)
public static String bytesToString(byte[] bytes)
public static String md5(byte[] bytes)
public static char rndChar()
public static String rndStr(int length)
public static String rndStr(int minLength, int maxLength)
public static int rnd(int n)
public static int rndExcept(int n,
int except)
public static <T> T rnd(T[] arr)
public static int rnd()
public static long rndL()
public static MappedByteBuffer mmap(String filename, FileChannel.MapMode mode, long position, long size)
public static MappedByteBuffer mmap(String filename, FileChannel.MapMode mode)
public static boolean production()
public static ByteBuffer expand(ByteBuffer buf, int newSize)
public static ByteBuffer expand(ByteBuffer buf)
public static String buf2str(ByteBuffer buf)
public static ByteBuffer buf(String s)
public static void args(String... args)
public static void benchmarkComplete(String name, int count, long startTime)
public static void benchmarkMT(int threadsN,
String name,
int count,
CountDownLatch outsideLatch,
Runnable runnable)
public static String getCpuMemStats()
public static <T> boolean eval(Predicate<T> predicate, T target)
public static <FROM,TO> TO eval(Mapper<FROM,TO> mapper, FROM src)
public static List<Class<?>> classpathClasses(String packageName, String nameRegex, Predicate<Class<?>> filter, ClassLoader classLoader)
public static List<Class<?>> classpathClassesByName(String simpleName, Predicate<Class<?>> filter, ClassLoader classLoader)
public static List<Class<?>> classpathClassesBySuffix(String nameSuffix, Predicate<Class<?>> filter, ClassLoader classLoader)
public static void classpath(String packageName, Collection<File> files, Predicate<File> filter)
public static boolean isJREClass(String canonicalClassName)
Copyright © 2014 Nikolche Mihajlovski. All rights reserved.