|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acsinet_solutions.util.Utils
public final class Utils
Useful utility methods that are so generic to put in more specialized classes.
| Method Summary | ||
|---|---|---|
static int |
compare(java.lang.Comparable obj1,
java.lang.Comparable obj2)
Compare two objects. |
|
static java.util.Map<java.lang.Integer,java.lang.String> |
createIntMap(int from,
int to)
Create an ordered map with Integer keys and String values whose values go between the given limits ( both inclusive ) |
|
static boolean |
equal(java.lang.Object obj1,
java.lang.Object obj2)
Test equality between the given objects. |
|
static java.util.Set |
getDifference(java.util.Set set1,
java.util.Set set2)
Get a Set that results from the difference between set1 and set2 |
|
static java.lang.String |
getFileName(java.lang.String path)
Get the file name for the given path. |
|
static int |
getFirstInt(java.util.List list)
Get the first element of the list as an int value. |
|
static java.util.Locale |
getLocale(java.lang.String language,
java.lang.String country,
java.lang.String variant)
Obtain a locale for the given language, country and variant values. |
|
static java.lang.String |
getString(java.util.Map map,
java.lang.String key,
java.lang.Object[] params)
Get the possible formatted text. |
|
static java.lang.String |
getString(java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object[] params)
Get the possible formatted text. |
|
static int |
hashCode(java.lang.Object obj)
Return the hashCode for the given object. |
|
static void |
homologate(java.util.Set source,
java.util.Set target)
Homologate the contents of source set into target set |
|
static boolean |
isAbsoluteURLPath(java.lang.String path)
Check if the provided path represents an absolute URL path ( starts with '/' or with 'http:' or with 'https:' ). |
|
static boolean |
isWellFormedEMail(java.lang.String str)
Check whether the given input string is a well-formed email or not. |
|
static boolean |
isWellFormedHost(java.lang.String str)
Check whether the given input string is a well-formed hostname or IP Address or not. |
|
static java.lang.String |
limit(java.lang.String str,
int limit,
int threshold,
java.lang.String append)
Limit a string to a given size |
|
static java.lang.String |
readerToString(java.io.Reader reader)
Get the given reader into a String instance |
|
static
|
serializedCopy(T source)
Copy a bean class using serialization mechanisms |
|
static void |
write(java.io.InputStream istream,
java.io.OutputStream ostream)
Write the contents of the given input stream into the output stream |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean equal(java.lang.Object obj1,
java.lang.Object obj2)
obj1 - A maybe-null Object instanceobj2 - A maybe-null Object instance
public static int hashCode(java.lang.Object obj)
obj - A maybe-null Object reference
public static int compare(java.lang.Comparable obj1,
java.lang.Comparable obj2)
obj1 - A maybe-null Object instanceobj2 - A maybe-null Object instance
public static final java.lang.String limit(java.lang.String str,
int limit,
int threshold,
java.lang.String append)
str - A not-null not-empty String instancelimit - A nonnegative int valuepublic static boolean isWellFormedHost(java.lang.String str)
str - A not-null String that may contain a hostname of IP Address
public static boolean isWellFormedEMail(java.lang.String str)
str - A not-null String that may contain an email
public static boolean isAbsoluteURLPath(java.lang.String path)
public static java.util.Set getDifference(java.util.Set set1,
java.util.Set set2)
set1 - A not-null Set instanceset2 - A not-null Set instance
public static void homologate(java.util.Set source,
java.util.Set target)
public static java.util.Map<java.lang.Integer,java.lang.String> createIntMap(int from,
int to)
from - the initial value; must be lower than toto - the final valuepublic static int getFirstInt(java.util.List list)
public static java.lang.String readerToString(java.io.Reader reader)
throws java.io.IOException
reader - A not-null reader instnace
java.io.IOException
public static void write(java.io.InputStream istream,
java.io.OutputStream ostream)
throws java.io.IOException
java.io.IOExceptionpublic static <T extends java.io.Serializable> T serializedCopy(T source)
public static final java.lang.String getFileName(java.lang.String path)
public static java.util.Locale getLocale(java.lang.String language,
java.lang.String country,
java.lang.String variant)
public static java.lang.String getString(java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object[] params)
public static java.lang.String getString(java.util.Map map,
java.lang.String key,
java.lang.Object[] params)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||