|
StocksMonitor 1.5.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 List<String> |
getListFromString(String aText)
Convert a Collection represented in the form of AbstractCollection.toString into a List of String objects. |
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 boolean |
isZeroMoney(BigDecimal aMoney)
Return true only if aMoney equals Consts.ZERO_MONEY or Consts.ZERO_MONEY_WITH_DECIMAL. |
static Boolean |
parseBoolean(String aBoolean)
Return true if aBoolean equals "true" (ignore case), or false if aBoolean equals "false" (ignore case). |
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.
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 final List<String> getListFromString(String aText)
Intended for use as an aid in parsing collections of objects which were stored in their toString form. This method will not parse such Strings into the original objects, but will aid in doing so by tokenizing it into its parts.
aText - has format of AbstractCollection.toString
public static boolean isZeroMoney(BigDecimal aMoney)
Consts.ZERO_MONEY or Consts.ZERO_MONEY_WITH_DECIMAL.
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.
|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||