- java.lang.Object
-
- de.siegmar.fastcsv.util.Preconditions
-
public final class Preconditions extends java.lang.Object
Internal utility class.It is not a part of the API!
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Preconditions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkArgument(boolean expression, java.lang.String errorMessage)
Checks the given argument and throws an exception if not met.static void
checkArgument(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)
Checks the given argument and throws an exception if not met.
-
-
-
Method Detail
-
checkArgument
public static void checkArgument(boolean expression, java.lang.String errorMessage)
Checks the given argument and throws an exception if not met.- Parameters:
expression
- the expression that has to betrue
errorMessage
- the exception message to be thrown- Throws:
java.lang.IllegalArgumentException
- if theexpression
isfalse
.
-
checkArgument
public static void checkArgument(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)
Checks the given argument and throws an exception if not met.- Parameters:
expression
- the expression that has to betrue
errorMessageTemplate
- the exception message template (formatString.format(String, Object...)
) to be thrownerrorMessageArgs
- the exception message arguments- Throws:
java.lang.IllegalArgumentException
- if theexpression
isfalse
.
-
-