java.lang.Object
com.dynatrace.hash4j.internal.Preconditions
Utility class for preconditions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(boolean expression) Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.static voidcheckArgument(boolean expression, String errorMessage) Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.static voidcheckArgument(boolean expression, String errorMessageFormatString, long value) Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.static voidcheckState(boolean expression) Throws anIllegalStateExceptionif the given expression evaluates tofalse.
-
Method Details
-
checkArgument
public static void checkArgument(boolean expression) Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.- Parameters:
expression- an expression- Throws:
IllegalArgumentException- if the given expression evaluates tofalse
-
checkState
public static void checkState(boolean expression) Throws anIllegalStateExceptionif the given expression evaluates tofalse.- Parameters:
expression- an expression- Throws:
IllegalStateException- if the given expression evaluates tofalse
-
checkArgument
Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.- Parameters:
expression- an expressionerrorMessage- an error message- Throws:
IllegalArgumentException- if the given expression evaluates tofalse
-
checkArgument
Throws anIllegalArgumentExceptionif the given expression evaluates tofalse.- Parameters:
expression- an expressionerrorMessageFormatString- an error message format string with a single %s place holdervalue- a long value- Throws:
IllegalArgumentException- if the given expression evaluates tofalse
-