Package org.gbif.utils
Class PreconditionUtils
java.lang.Object
org.gbif.utils.PreconditionUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(boolean expression) Ensures the truth of an expression involving one or more parameters to the calling method.static voidcheckArgument(boolean expression, Object errorMessage) Ensures the truth of an expression involving one or more parameters to the calling method.static voidcheckState(boolean expression) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static voidcheckState(boolean expression, Object errorMessage) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
-
Method Details
-
checkState
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. From Guava.- Parameters:
expression- a boolean expression- Throws:
IllegalStateException- ifexpressionis false
-
checkState
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. From Guava.- Parameters:
expression- a boolean expressionerrorMessage- the exception message to use if the check fails; will be converted to a string usingString.valueOf(Object)- Throws:
IllegalStateException- ifexpressionis false
-
checkArgument
Ensures the truth of an expression involving one or more parameters to the calling method. From Guava.- Parameters:
expression- a boolean expression- Throws:
IllegalArgumentException- ifexpressionis false
-
checkArgument
Ensures the truth of an expression involving one or more parameters to the calling method. From Guava.- 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- ifexpressionis false
-