|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.util.ParamChecker
public class ParamChecker
Utility class to check common parameter preconditions.
| Constructor Summary | |
|---|---|
ParamChecker()
|
|
| Method Summary | ||
|---|---|---|
static Date |
checkDateOozieTZ(String date,
String name)
Check whether the value is Oozie processing timezone data format. |
|
static int |
checkGEZero(int value,
String name)
Check whether the value is greater than or equals to 0. |
|
static int |
checkGTZero(int value,
String name)
Check whether the value is greater than or equals 0. |
|
static int |
checkInteger(String val,
String name)
Check whether the value is Integer. |
|
static TimeZone |
checkTimeZone(String tzStr,
String name)
Check whether the value mention correct Timezone. |
|
static boolean |
isMember(String item,
String[] members,
String name)
Check whether an item is a member of an array of string |
|
static boolean |
isValidIdentifier(String token)
Return if the specified token is a valid Java identifier. |
|
static String |
notEmpty(String str,
String name)
Check that a string is not null and not empty. |
|
static List<String> |
notEmptyElements(List<String> list,
String name)
Check that a list is not null and that none of its elements is null. |
|
static
|
notNull(T obj,
String name)
Check that a value is not null. |
|
static
|
notNullElements(List<T> list,
String name)
Check that a list is not null and that none of its elements is null. |
|
static String |
validateActionName(String actionName)
Check that the given string is a valid action name [a-zA-Z_][0-9a-zA-Z_\-]* and not longer than 50 chars. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParamChecker()
| Method Detail |
|---|
public static <T> T notNull(T obj,
String name)
obj - value.name - parameter name for the exception message.
public static <T> List<T> notNullElements(List<T> list,
String name)
list - the list of strings.name - parameter name for the exception message.
public static String notEmpty(String str,
String name)
str - value.name - parameter name for the exception message.
public static List<String> notEmptyElements(List<String> list,
String name)
list - the list of strings.name - parameter name for the exception message.
public static String validateActionName(String actionName)
actionName - string to validate is a token.
public static boolean isValidIdentifier(String token)
token - string to validate if it is a valid Java identifier.
public static int checkGTZero(int value,
String name)
value - : value to testname - : Name of the parameter
public static int checkGEZero(int value,
String name)
value - : value to testname - : Name of the parameter
public static int checkInteger(String val,
String name)
value - : value to testname - : Name of the parameter
public static Date checkDateOozieTZ(String date,
String name)
value - : value to testname - : Name of the parameter
public static TimeZone checkTimeZone(String tzStr,
String name)
value - : value to testname - : Name of the parameter
public static boolean isMember(String item,
String[] members,
String name)
item - : item to testmembers - : List of items in stringname - : Name of the parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||