public class ParamChecker extends java.lang.Object
| Constructor and Description |
|---|
ParamChecker() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Date |
checkDateOozieTZ(java.lang.String date,
java.lang.String name)
Check whether the value is Oozie processing timezone data format.
|
static java.lang.String |
checkFrequency(java.lang.String val)
Check whether a value is a valid coordinator frequency.
|
static int |
checkGEZero(int value,
java.lang.String name)
Check whether the value is greater than or equals to 0.
|
static int |
checkGTZero(int value,
java.lang.String name)
Check whether the value is greater than or equals 0.
|
static int |
checkInteger(java.lang.String val,
java.lang.String name)
Check whether the value is Integer.
|
static int |
checkLEZero(int value,
java.lang.String name)
Check whether the value is less than or equal to 0.
|
static java.util.TimeZone |
checkTimeZone(java.lang.String tzStr,
java.lang.String name)
Check whether the value mention correct Timezone.
|
static boolean |
isMember(java.lang.String item,
java.lang.String[] members,
java.lang.String name)
Check whether an item is a member of an array of string
|
static boolean |
isValidIdentifier(java.lang.String token)
Return if the specified token is a valid Java identifier.
|
static java.lang.String |
notEmpty(java.lang.String str,
java.lang.String name)
Check that a string is not null and not empty.
|
static java.lang.String |
notEmpty(java.lang.String str,
java.lang.String name,
java.lang.String info)
Check that a string is not null and not empty.
|
static java.util.List<java.lang.String> |
notEmptyElements(java.util.List<java.lang.String> list,
java.lang.String name)
Check that a list is not null and that none of its elements is null.
|
static <T> T |
notNull(T obj,
java.lang.String name)
Check that a value is not null.
|
static <T> java.util.List<T> |
notNullElements(java.util.List<T> list,
java.lang.String name)
Check that a list is not null and that none of its elements is null.
|
static java.lang.String |
validateActionName(java.lang.String actionName)
Check that the given string is a valid action name [a-zA-Z_][0-9a-zA-Z_\-]* and not longer than 128 chars.
|
public ParamChecker()
public static <T> T notNull(T obj, java.lang.String name)
obj - value.name - parameter name for the exception message.public static <T> java.util.List<T> notNullElements(java.util.List<T> list, java.lang.String name)
list - the list of strings.name - parameter name for the exception message.public static java.lang.String notEmpty(java.lang.String str, java.lang.String name)
str - value.name - parameter name for the exception message.public static java.lang.String notEmpty(java.lang.String str, java.lang.String name, java.lang.String info)
str - value.name - parameter name for the exception message.info - additional information to be printed with the exception messagepublic static java.util.List<java.lang.String> notEmptyElements(java.util.List<java.lang.String> list, java.lang.String name)
list - the list of strings.name - parameter name for the exception message.public static java.lang.String validateActionName(java.lang.String actionName)
actionName - string to validate is a token.public static boolean isValidIdentifier(java.lang.String token)
token - string to validate if it is a valid Java identifier.public static int checkGTZero(int value, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static int checkGEZero(int value, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static int checkLEZero(int value, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static int checkInteger(java.lang.String val, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static java.lang.String checkFrequency(java.lang.String val)
value - : value to testpublic static java.util.Date checkDateOozieTZ(java.lang.String date, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static java.util.TimeZone checkTimeZone(java.lang.String tzStr, java.lang.String name)
value - : value to testname - : Name of the parameterpublic static boolean isMember(java.lang.String item, java.lang.String[] members, java.lang.String name)
item - : item to testmembers - : List of items in stringname - : Name of the parameterCopyright © 2018 Apache Software Foundation. All Rights Reserved.