public final class Preconditions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkDuration(String duration,
String name)
Enforces that the duration is a valid influxDB duration.
|
static String |
checkNonEmptyString(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 |
checkPositiveNumber(Number number,
String name)
Enforces that the number is larger than 0.
|
public static String checkNonEmptyString(String string, String name) throws IllegalArgumentException
string
- the string to testname
- variable name for reportingstring
IllegalArgumentException
- if the string is emptypublic 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 checkDuration(String duration, String name) throws IllegalArgumentException
duration
- the duration to testname
- variable name for reportingIllegalArgumentException
- if the given duration is not valid.Copyright © 2019. All rights reserved.