Package org.gbif.api.util
Class PreconditionUtils
- java.lang.Object
-
- org.gbif.api.util.PreconditionUtils
-
public final class PreconditionUtils extends Object
Analogues of methods from guava's Preconditions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkArgument(boolean expression)
Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument(boolean expression, Object errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method.
-
-
-
Method Detail
-
checkArgument
public static void checkArgument(boolean expression)
Ensures the truth of an expression involving one or more parameters to the calling method.- Parameters:
expression
- a boolean expression- Throws:
IllegalArgumentException
- ifexpression
is false
-
checkArgument
public static void checkArgument(boolean expression, @Nullable Object errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method.- Parameters:
expression
- a boolean expressionerrorMessage
- the exception message to use if the check fails; will be converted to a string usingString.valueOf(Object)
- Throws:
IllegalArgumentException
- ifexpression
is false
-
-