Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
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.
|
public Util()
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.InvalidInputException
public 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
Copyright Hirondelle Systems - Generated 2013Sep20.11.16