public final class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
getFileOrResource(String name)
Looks for a file in the file system path named
name, if none
exist looks for a resource named name inside the current class
path. |
static boolean |
isNullOrEmpty(String string)
Returns
true if the given string is null or is the empty string. |
static <E> ArrayList<E> |
newArrayList()
Creates a mutable, empty
ArrayList instance. |
static <K,V> HashMap<K,V> |
newHashMap()
Creates a mutable, empty
HashMap instance. |
static <K,V> HashMap<K,V> |
newHashMap(K key,
V value)
Creates a mutable,
HashMap instance with one entry. |
static <E> HashSet<E> |
newHashSet()
Creates a mutable, empty
HashSet instance. |
public static <E> ArrayList<E> newArrayList()
ArrayList instance.ArrayListpublic static <K,V> HashMap<K,V> newHashMap()
HashMap instance.HashMappublic static <K,V> HashMap<K,V> newHashMap(K key, V value)
HashMap instance with one entry.HashMappublic static <E> HashSet<E> newHashSet()
HashSet instance.HashSetpublic static boolean isNullOrEmpty(String string)
true if the given string is null or is the empty string.string - a string reference to checktrue if the string is null or is the empty stringpublic static InputStream getFileOrResource(String name) throws IOException
name, if none
exist looks for a resource named name inside the current class
path.name - a file or a resource name to findInputStreamIOExceptionCopyright © 2014. All Rights Reserved.