|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cert.cc.util.NullSafe
public final class NullSafe
NullSafe is a collection of null and thread safe static methods.
© 2010 Carnegie Mellon University
Method Summary | |
---|---|
static Calendar |
clone(Calendar input)
Creates a new Calendar from an existing one |
static boolean |
equals(Object o1,
Object o2)
Returns if two objects are equals. |
static Calendar |
incrementDays(Calendar input,
int numberOfDays)
Increments input Calendar the number of days specified. |
static Calendar |
incrementDays(Date d,
int numberOfDays)
Increments input Date the number of days specified. |
static boolean |
isDigitsOnly(String s)
Returns if the String contains only digits. |
static boolean |
isEmpty(String s)
Returns if a String is empty. |
static boolean |
isWeekend(Calendar c)
Returns if the Calendar 's current day is a weekend day |
static boolean |
toBoolean(String s)
Returns a boolean created from a String. |
static String |
trim(String s)
Returns a trimmed String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Calendar incrementDays(Calendar input, int numberOfDays)
input
Calendar
the number of days specified. Weekend
days are skipped. The original Calendar
is not changed.
input
- Input Calendar
numberOfDays
- Number of days
Calendar
public static Calendar incrementDays(Date d, int numberOfDays)
input
Date
the number of days specified. Weekend
days are skipped. The original Date
is not changed.
input
- Input Date
numberOfDays
- Number of days
Calendar
public static Calendar clone(Calendar input)
Calendar
from an existing one
public static boolean isWeekend(Calendar c)
Calendar
's current day is a weekend day
public static boolean isEmpty(String s)
s
is nullString
that only contains whitespace
s
- Input String
public static boolean isDigitsOnly(String s)
public static String trim(String s)
null input returns a null
- Parameters:
s
- String
- Returns:
- trimmed String
public static boolean equals(Object o1, Object o2)
true
is returned.
o1
- first objecto2
- second object
public static boolean toBoolean(String s)
false
is returned.
yes
, true
, and 1
are all considered true
;
everything else is false
. The check is case-insensitive.
s
- String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |