| Modifier and Type | Method and Description |
|---|---|
static String |
checkDuration(String string,
String name)
Enforces that the string is duration literal.
|
static String |
checkDurationNotRequired(String string,
String name)
Enforces that the string is duration literal.
|
static String |
checkNonEmpty(String string,
String name)
Enforces that the string is not empty.
|
static void |
checkNotNegativeNumber(Number number,
String name)
Enforces that the number is not negative.
|
static void |
checkNotNull(Object obj,
String name)
Checks that the specified object reference is not
null. |
static String |
checkOneCharString(String string,
String name)
Enforces that the string has exactly one char.
|
static void |
checkPositiveNumber(Number number,
String name)
Enforces that the number is larger than 0.
|
static void |
checkPrecision(ChronoUnit precision)
Checks that the precision reference to one of
ALLOWED_PRECISION. |
public static String checkNonEmpty(String string, String name) throws IllegalArgumentException
string - the string to testname - variable name for reportingstringIllegalArgumentException - if the string is emptypublic static String checkOneCharString(String string, String name) throws IllegalArgumentException
string - the string to testname - variable name for reportingstringIllegalArgumentException - if the string has not one charpublic static String checkDuration(String string, String name) throws IllegalArgumentException
string - the string to testname - variable name for reportingstringIllegalArgumentException - if the string is not duration literalpublic static String checkDurationNotRequired(String string, String name) throws IllegalArgumentException
string - the string to testname - variable name for reportingstringIllegalArgumentException - if the string is not duration literalpublic static void checkPositiveNumber(Number number, String name) throws IllegalArgumentException
number - the number to testname - variable name for reportingIllegalArgumentException - if the number is less or equal to 0public static void checkNotNegativeNumber(Number number, String name) throws IllegalArgumentException
number - the number to testname - variable name for reportingIllegalArgumentException - if the number is less or equal to 0public static void checkNotNull(Object obj, String name) throws NullPointerException
null.obj - the object reference to check for nullityname - variable name for reportingNullPointerException - if the object is nullObjects.requireNonNull(Object, String)public static void checkPrecision(@Nullable ChronoUnit precision) throws IllegalArgumentException
ALLOWED_PRECISION.IllegalArgumentException - if the object is not one of ALLOWED_PRECISIONCopyright © 2018–2021 InfluxData, Inc.. All rights reserved.