public class Misc
extends java.lang.Object
Zephyr Business Solutions Corp.
Modifier and Type | Field and Description |
---|---|
static java.lang.Object[] |
array0
An empty array.
|
Constructor and Description |
---|
Misc() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Compares two objects.
|
static java.io.File |
getAbsolutePath(java.io.File root,
java.io.File path)
Get the File object for the real path designated by
root/path when path is relative,
or path when it is absolute or starts with a '/'
|
static int |
getArrayHashcode(java.lang.Object[] arr)
Get the hashcode for an array of objects using value semantics.
|
static java.lang.Class |
getArrayType(java.lang.Class ctype)
Get the array type of a Class object.
|
static java.lang.String |
getTypeName(java.lang.Class c)
Get the human readable type name of a class.
|
static java.lang.Class |
getWrapperType(java.lang.Class t)
If the type is a primitive type, get the corresponding wrapper type.
|
static int |
hashcode(java.lang.Object obj)
Get the hashcode for an object.
|
static boolean |
isPrimitiveOf(java.lang.Class t1,
java.lang.Class t2)
Determines whether t2 is a wrapper type of t1.
|
static java.util.Properties |
loadPropertiesFile(java.io.File file)
To load properties from a properties file.
|
static java.util.Properties |
loadResourceProperties(java.lang.ClassLoader loader,
java.lang.String resource)
To read a property file from a class loader
into a Properties object.
|
static java.util.Map |
readConstants(java.lang.Class c)
Reads all the constants value and put them in a map.
|
public static java.lang.Class getArrayType(java.lang.Class ctype)
ctype
- the component type.public static java.lang.String getTypeName(java.lang.Class c)
c
- the class object.public static java.lang.Class getWrapperType(java.lang.Class t)
t
- the type.public static boolean isPrimitiveOf(java.lang.Class t1, java.lang.Class t2)
t1
- the first type.t2
- the second type.public static java.util.Map readConstants(java.lang.Class c)
c
- the class.public static int getArrayHashcode(java.lang.Object[] arr)
arr
- the array.public static int hashcode(java.lang.Object obj)
obj
- the object.public static boolean equals(java.lang.Object o1, java.lang.Object o2)
o1
- the first object.o2
- the second object.public static java.io.File getAbsolutePath(java.io.File root, java.io.File path) throws java.io.IOException
root
- the root.path
- the path.java.io.IOException
public static java.util.Properties loadResourceProperties(java.lang.ClassLoader loader, java.lang.String resource) throws java.io.IOException
loader
- the ClassLoader used to load resource.resource
- the resource name.java.io.IOException
- when loading fails.public static java.util.Properties loadPropertiesFile(java.io.File file) throws java.io.IOException
file
- the properties file.java.io.IOException
- when io error happens.