public final class Utilities extends Object
| Constructor and Description |
|---|
Utilities() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
append(T[] firstArray,
T[] secondArray)
Expands an array by appending a second array.
|
static <T> List<T> |
append(T t,
T... ts)
Combines
t and ts into one single list of size 1 + ts.length. |
static <T> T[] |
array(T... ts)
Builds an array from varargs.
|
static <T> T |
buildInstanceOf(Class<T> cls)
Supplies an instance of the specified class.
|
static <T> T |
notNull(T t,
String name)
Ensures that
t is not null. |
static String |
toString(Object object,
Object... members)
Default implementation for
Object.toString(). |
public static final <T> T buildInstanceOf(Class<T> cls)
T - The class provided to cls.cls - The class of which an instance is to be supplied, or null.null if it is impossible to obtain it (e. g. the class does not exist or cls is
null:public static final <T> T[] append(T[] firstArray,
T[] secondArray)
firstArray - The array to expand by appending the second array.secondArray - The array to append to the first array.public static final <T> T notNull(T t,
String name)
throws NullArgumentException
t is not null.t - The argument to check.name - The name of the argument.tNullArgumentException - in case t is null.public static final <T> List<T> append(T t, T... ts)
t and ts into one single list of size 1 + ts.length.t - Set into the first position of the new list. Must not be null.ts - Appended starting at position 1 into the new list. Must not be null.t then content of ts.public static final <T> T[] array(T... ts)
ts - Will become the content of the array.public static final String toString(Object object, Object... members)
Object.toString().object - The object for which to produce the string.members - The object's members for which to produce the string.Copyright © 2008-2014 The java.net WebDAV Project. All Rights Reserved.