public final class Preconditions extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
checkNonEmptyString(String string,
String name)
Enforces that the string is not empty.
|
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 reportingstringIllegalArgumentException - 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 0Copyright © 2017. All rights reserved.