Package com.influxdb.v3.client.internal
Class Arguments
java.lang.Object
com.influxdb.v3.client.internal.Arguments
Functions for parameter validation.
 
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringcheckDuration(String string, String name) Enforces that the string is duration literal.static StringcheckDurationNotRequired(String string, String name) Enforces that the string is duration literal.static StringcheckNonEmpty(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 voidcheckNotNull(Object obj, String name) Checks that the specified object reference is notnull.static StringcheckOneCharString(String string, String name) Enforces that the string has exactly one char.static voidcheckPositiveNumber(Number number, String name) Enforces that the number is larger than 0.static voidcheckPrecision(ChronoUnit precision) Checks that the precision reference to one ofALLOWED_PRECISION.
- 
Method Details- 
checkNonEmptyEnforces that the string is not empty.- Parameters:
- string- the string to test
- name- variable name for reporting
- Returns:
- string
- Throws:
- IllegalArgumentException- if the string is empty
 
- 
checkOneCharStringEnforces that the string has exactly one char.- Parameters:
- string- the string to test
- name- variable name for reporting
- Returns:
- string
- Throws:
- IllegalArgumentException- if the string has not one char
 
- 
checkDurationEnforces that the string is duration literal.- Parameters:
- string- the string to test
- name- variable name for reporting
- Returns:
- string
- Throws:
- IllegalArgumentException- if the string is not duration literal
 
- 
checkDurationNotRequiredpublic 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 test
- name- variable name for reporting
- Returns:
- string
- Throws:
- IllegalArgumentException- if the string is not duration literal
 
- 
checkPositiveNumberEnforces that the number is larger than 0.- Parameters:
- number- the number to test
- name- variable name for reporting
- Throws:
- IllegalArgumentException- if the number is less or equal to 0
 
- 
checkNotNegativeNumberpublic static void checkNotNegativeNumber(Number number, String name) throws IllegalArgumentException Enforces that the number is not negative.- Parameters:
- number- the number to test
- name- variable name for reporting
- Throws:
- IllegalArgumentException- if the number is less or equal to 0
 
- 
checkNotNullChecks that the specified object reference is notnull.- Parameters:
- obj- the object reference to check for nullity
- name- variable name for reporting
- Throws:
- NullPointerException- if the object is- null
- See Also:
 
- 
checkPrecisionChecks that the precision reference to one ofALLOWED_PRECISION.- Parameters:
- precision- the precision to check
- Throws:
- IllegalArgumentException- if the object is not one of- ALLOWED_PRECISION
 
 
-