类 Preconditions


  • public class Preconditions
    extends java.lang.Object
    Check precondition, throws an IllegalArgumentException If the conditions are not met.
    作者:
    zzq
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static void checkArgument​(boolean expression, java.lang.Object errorMessage)
      check precondition.
      static void checkArgument​(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)
      check precondition.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Preconditions

        public Preconditions()
    • 方法详细资料

      • checkArgument

        public static void checkArgument​(boolean expression,
                                         java.lang.Object errorMessage)
        check precondition.
        参数:
        expression - a boolean expression
        errorMessage - the exception message to use if the check fails
        抛出:
        java.lang.IllegalArgumentException - if expression is false
      • checkArgument

        public static void checkArgument​(boolean expression,
                                         java.lang.String errorMessageTemplate,
                                         java.lang.Object... errorMessageArgs)
        check precondition.
        参数:
        expression - a boolean expression
        errorMessageTemplate - the exception message template to use if the check fails
        errorMessageArgs - the arguments to be substituted into the message template.
        抛出:
        java.lang.IllegalArgumentException - if expression is false