类 Preconditions
java.lang.Object
com.alibaba.nacos.common.utils.Preconditions
Check precondition, throws an
IllegalArgumentException If the conditions are not met.- 作者:
- zzq
-
方法概要
修饰符和类型方法说明static voidcheckArgument(boolean expression, Object errorMessage) check precondition.static voidcheckArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) check precondition.
-
方法详细资料
-
checkArgument
check precondition.- 参数:
expression- a boolean expressionerrorMessage- the exception message to use if the check fails- 抛出:
IllegalArgumentException- ifexpressionis false
-
checkArgument
public static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) check precondition.- 参数:
expression- a boolean expressionerrorMessageTemplate- the exception message template to use if the check failserrorMessageArgs- the arguments to be substituted into the message template.- 抛出:
IllegalArgumentException- ifexpressionis false
-