Package org.apache.parquet
Class Preconditions
java.lang.Object
org.apache.parquet.Preconditions
Utility for parameter validation
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(boolean isValid, String message) Precondition-style validation that throwsIllegalArgumentException.static voidcheckArgument(boolean isValid, String message, Object arg0) Precondition-style validation that throwsIllegalArgumentException.static voidcheckArgument(boolean isValid, String message, Object... args) Precondition-style validation that throwsIllegalArgumentException.static voidcheckArgument(boolean isValid, String message, Object arg0, Object arg1) Precondition-style validation that throwsIllegalArgumentException.static voidcheckArgument(boolean isValid, String message, Object arg0, Object arg1, Object arg2) Precondition-style validation that throwsIllegalArgumentException.static <T> TcheckNotNull(T o, String name) Deprecated.static voidcheckState(boolean isValid, String message) Precondition-style validation that throwsIllegalStateException.static voidcheckState(boolean isValid, String message, Object arg0) Precondition-style validation that throwsIllegalStateException.static voidcheckState(boolean isValid, String message, Object... args) Precondition-style validation that throwsIllegalStateException.static voidcheckState(boolean isValid, String message, Object arg0, Object arg1) Precondition-style validation that throwsIllegalStateException.static voidcheckState(boolean isValid, String message, Object arg0, Object arg1, Object arg2) Precondition-style validation that throwsIllegalStateException.
-
Method Details
-
checkNotNull
Deprecated.- Type Parameters:
T- the type of the object- Parameters:
o- the param to checkname- the name of the param for the error message- Returns:
- the validated o
- Throws:
NullPointerException- if o is null
-
checkArgument
Precondition-style validation that throwsIllegalArgumentException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.- Throws:
IllegalArgumentException- ifisValidis false
-
checkArgument
public static void checkArgument(boolean isValid, String message, Object arg0) throws IllegalArgumentException Precondition-style validation that throwsIllegalArgumentException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string template- Throws:
IllegalArgumentException- ifisValidis false
-
checkArgument
public static void checkArgument(boolean isValid, String message, Object arg0, Object arg1) throws IllegalArgumentException Precondition-style validation that throwsIllegalArgumentException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string templatearg1- Second parameter of the message string template- Throws:
IllegalArgumentException- ifisValidis false
-
checkArgument
public static void checkArgument(boolean isValid, String message, Object arg0, Object arg1, Object arg2) throws IllegalArgumentException Precondition-style validation that throwsIllegalArgumentException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string templatearg1- Second parameter of the message string templatearg2- Third parameter of the message string template- Throws:
IllegalArgumentException- ifisValidis false
-
checkArgument
public static void checkArgument(boolean isValid, String message, Object... args) throws IllegalArgumentException Precondition-style validation that throwsIllegalArgumentException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.args- Objects used to fill in%splaceholders in the message- Throws:
IllegalArgumentException- ifisValidis false
-
checkState
Precondition-style validation that throwsIllegalStateException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.- Throws:
IllegalStateException- ifisValidis false
-
checkState
public static void checkState(boolean isValid, String message, Object arg0) throws IllegalStateException Precondition-style validation that throwsIllegalStateException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string template- Throws:
IllegalStateException- ifisValidis false
-
checkState
public static void checkState(boolean isValid, String message, Object arg0, Object arg1) throws IllegalStateException Precondition-style validation that throwsIllegalStateException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string templatearg1- Second parameter of the message string template- Throws:
IllegalStateException- ifisValidis false
-
checkState
public static void checkState(boolean isValid, String message, Object arg0, Object arg1, Object arg2) throws IllegalStateException Precondition-style validation that throwsIllegalStateException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.arg0- First parameter of the message string templatearg1- Second parameter of the message string templatearg2- Third parameter of the message string template- Throws:
IllegalStateException- ifisValidis false
-
checkState
public static void checkState(boolean isValid, String message, Object... args) throws IllegalStateException Precondition-style validation that throwsIllegalStateException.- Parameters:
isValid-trueif valid,falseif an exception should be thrownmessage- A String message for the exception.args- Objects used to fill in%splaceholders in the message- Throws:
IllegalStateException- ifisValidis false
-
Objects.requireNonNull(Object, String)