Class Validate
java.lang.Object
org.apache.jackrabbit.oak.commons.conditions.Validate
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(boolean expression) Checks the specified expressionstatic voidcheckArgument(boolean expression, @NotNull String message) Checks the specified expressionstatic voidcheckArgument(boolean expression, @NotNull String messageTemplate, @Nullable Object... messageArgs) Checks the specified expressionstatic voidcheckState(boolean expression) Checks whether the specified expression is truestatic voidcheckState(boolean expression, @NotNull Object errorMessage) Checks whether the specified expression is truestatic voidcheckState(boolean expression, @NotNull String messageTemplate, @Nullable Object... messageArgs) Checks whether the specified expression is true
-
Method Details
-
checkArgument
Checks the specified expression- Parameters:
expression- to check- Throws:
IllegalArgumentException- when false
-
checkArgument
public static void checkArgument(boolean expression, @NotNull @NotNull String message) throws IllegalArgumentException Checks the specified expression- Parameters:
expression- to checkmessage- to use in exception- Throws:
IllegalArgumentException- when false
-
checkArgument
public static void checkArgument(boolean expression, @NotNull @NotNull String messageTemplate, @Nullable @Nullable Object... messageArgs) Checks the specified expression- Parameters:
expression- to checksmessageTemplate- to use in exception (usingString.format(java.lang.String, java.lang.Object...)syntax- Throws:
IllegalArgumentException- when false
-
checkState
public static void checkState(boolean expression) Checks whether the specified expression is true- Parameters:
expression- expression to checks- Throws:
IllegalStateException- if expression is false
-
checkState
Checks whether the specified expression is true- Parameters:
expression- expression to checkserrorMessage- message to use in exception- Throws:
IllegalStateException- if expression is false
-
checkState
public static void checkState(boolean expression, @NotNull @NotNull String messageTemplate, @Nullable @Nullable Object... messageArgs) Checks whether the specified expression is true- Parameters:
expression- expression to checksmessageTemplate- to use in exception (usingString.format(java.lang.String, java.lang.Object...)syntaxmessageArgs- arguments to use in messageTemplate- Throws:
IllegalArgumentException- if expression is false
-