|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectUtil
public final class Util
Static convenience methods for common tasks, which eliminate code duplication.
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static String |
format(Object aObject)
Format an arbitrary Object, into a form suitable for the end user. |
static Logger |
getLogger(Class<?> aClass)
Return a Logger whose name follows a specific naming convention. |
static boolean |
isInRange(int aNumber,
int aLow,
int aHigh)
Return true only if aNumber is in the range aLow..aHigh (inclusive). |
static BigDecimal |
parseBigDecimal(String aBigDecimal,
String aName)
Parse text into a BigDecimal. |
static Boolean |
parseBoolean(String aBoolean)
Return true if aBoolean equals "true" (ignore case), or false if aBoolean equals "false" (ignore case). |
static Date |
parseDate(String aDate,
String aName)
Parse text into a Date. |
static boolean |
textHasContent(String aText)
Return true only if aText is not null, and is not empty after trimming. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static boolean textHasContent(String aText)
For checking argument validity, Args.checkForContent(java.lang.String) should
be used instead of this method.
This method is particularly useful, since it is very commonly required.
aText - possibly-null.
public static boolean isInRange(int aNumber,
int aLow,
int aHigh)
For checking argument validity, Args.checkForRange(int, int, int) should
be used instead of this method.
aLow - less than or equal to aHigh.public static Boolean parseBoolean(String aBoolean)
Note that this behavior is different from that of Boolean.getValue.
aBoolean - equals "true" or "false" (not case-sensitive).public static Logger getLogger(Class<?> aClass)
Logger whose name follows a specific naming convention.
The conventional logger names are taken as aClass.getPackage().getName().
Logger names appearing in the logging.properties config file must match the names returned by this method.
public static Date parseDate(String aDate,
String aName)
throws InvalidInputException
Date. If the text has no content, then return null.
InvalidInputExceptionpublic static String format(Object aObject)
public static BigDecimal parseBigDecimal(String aBigDecimal,
String aName)
throws InvalidInputException
BigDecimal. If the text has no content, then return null.
InvalidInputException
|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||