程序包 com.cnosdb.impl
类 Preconditions
java.lang.Object
com.cnosdb.impl.Preconditions
Functions for parameter validation.
- 作者:
- Simon Legner
-
方法概要
修饰符和类型方法说明static voidcheckDuration(String duration, String name) Enforces that the duration is a valid cnosDB duration.static StringcheckNonEmptyString(String string, String name) Enforces that the string is not empty.static voidcheckNotNegativeNumber(Number number, String name) Enforces that the number is not negative.static voidcheckPositiveNumber(Number number, String name) Enforces that the number is larger than 0.
-
方法详细资料
-
checkNonEmptyString
public static String checkNonEmptyString(String string, String name) throws IllegalArgumentException Enforces that the string is not empty.- 参数:
string- the string to testname- variable name for reporting- 返回:
string- 抛出:
IllegalArgumentException- if the string is empty
-
checkPositiveNumber
Enforces that the number is larger than 0.- 参数:
number- the number to testname- variable name for reporting- 抛出:
IllegalArgumentException- if the number is less or equal to 0
-
checkNotNegativeNumber
public static void checkNotNegativeNumber(Number number, String name) throws IllegalArgumentException Enforces that the number is not negative.- 参数:
number- the number to testname- variable name for reporting- 抛出:
IllegalArgumentException- if the number is less or equal to 0
-
checkDuration
Enforces that the duration is a valid cnosDB duration.- 参数:
duration- the duration to testname- variable name for reporting- 抛出:
IllegalArgumentException- if the given duration is not valid.
-