Package org.gbif.api.util
Class PreconditionUtils
java.lang.Object
org.gbif.api.util.PreconditionUtils
Analogues of methods from guava's Preconditions
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
checkArgument
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
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
-