Package com.influxdb.v3.client.internal
Class Arguments
- java.lang.Object
-
- com.influxdb.v3.client.internal.Arguments
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 notnull
.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 ofALLOWED_PRECISION
.
-
-
-
Method Detail
-
checkNonEmpty
public static String checkNonEmpty(String string, String name) throws IllegalArgumentException
Enforces that the string is not empty.- Parameters:
string
- the string to testname
- variable name for reporting- Returns:
string
- Throws:
IllegalArgumentException
- if the string is empty
-
checkOneCharString
public static String checkOneCharString(String string, String name) throws IllegalArgumentException
Enforces that the string has exactly one char.- Parameters:
string
- the string to testname
- variable name for reporting- Returns:
string
- Throws:
IllegalArgumentException
- if the string has not one char
-
checkDuration
public static String checkDuration(String string, String name) throws IllegalArgumentException
Enforces that the string is duration literal.- Parameters:
string
- the string to testname
- variable name for reporting- Returns:
string
- Throws:
IllegalArgumentException
- if the string is not duration literal
-
checkDurationNotRequired
public static String checkDurationNotRequired(String string, String name) throws IllegalArgumentException
Enforces that the string is duration literal. Empty or null strings are valid.- Parameters:
string
- the string to testname
- variable name for reporting- Returns:
string
- Throws:
IllegalArgumentException
- if the string is not duration literal
-
checkPositiveNumber
public static void checkPositiveNumber(Number number, String name) throws IllegalArgumentException
Enforces that the number is larger than 0.- Parameters:
number
- the number to testname
- variable name for reporting- Throws:
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.- Parameters:
number
- the number to testname
- variable name for reporting- Throws:
IllegalArgumentException
- if the number is less or equal to 0
-
checkNotNull
public static void checkNotNull(Object obj, String name) throws NullPointerException
Checks that the specified object reference is notnull
.- Parameters:
obj
- the object reference to check for nullityname
- variable name for reporting- Throws:
NullPointerException
- if the object isnull
- See Also:
Objects.requireNonNull(Object, String)
-
checkPrecision
public static void checkPrecision(@Nullable ChronoUnit precision) throws IllegalArgumentException
Checks that the precision reference to one ofALLOWED_PRECISION
.- Parameters:
precision
- the precision to check- Throws:
IllegalArgumentException
- if the object is not one ofALLOWED_PRECISION
-
-