|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.util.Util
public final class Util
The Util class provides several convenience methods making application development easier.
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | ||
|---|---|---|
static
|
addArrayToCollection(Collection<T> collection,
T[] array)
Adds all elements of an array to a collection |
|
static
|
appendArrays(T[] array1,
T[] array2,
Class<T> cls)
Appends two arrays together. |
|
static Boolean |
equalsNoState(Object first,
Object second)
Determines if two objects are equal. |
|
static
|
listToArray(List<T> list,
Class<T> cls)
Copies a list to an Object array. |
|
static void |
printArray(PrintStream stream,
Object[] array)
Copies an array to a print stream. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static void printArray(PrintStream stream,
Object[] array)
stream - streamarray - array
IllegalArgumentException - if an argument is null
public static <T> T[] appendArrays(T[] array1,
T[] array2,
Class<T> cls)
array1 - first arrayarray2 - second arraycls - class of the objects in the array
IllegalArgumentException - if an argument is null
public static <T> void addArrayToCollection(Collection<T> collection,
T[] array)
collection - collectionarray - array
IllegalArgumentException - if an argument is null
public static <T> T[] listToArray(List<T> list,
Class<T> cls)
list - list that is used as inputcls - class of the objects in the list
IllegalArgumentException - if an argument is null
public static Boolean equalsNoState(Object first,
Object second)
The state is not taken into account if two objects are equal, and therefore this method can return null to signal that the internal state must be compared too before it can be determined if the objects are equal.
This method is useful as the first step in the equals method of objects.
first - first objectsecond - second object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||