类 ConditionChecks

java.lang.Object
gu.sql2java.store.ConditionChecks

public class ConditionChecks extends Object
条件检查工具类
作者:
guyadong
  • 方法详细资料

    • checkTrue

      public static <X extends Throwable> void checkTrue(boolean b, Class<X> declareType, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) throws X
      执行表达式,为false时抛出 declareType 异常
      类型参数:
      X - 抛出异常类型
      参数:
      b -
      declareType - 异常类型
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each %s placeholder in the template with an argument. These are matched by position - the first %s gets errorMessageArgs[0], etc. Unmatched arguments will be appended to the formatted message in square braces. Unmatched placeholders will be left as-is.
      errorMessageArgs - the arguments to be substituted into the message template. Arguments are converted to strings using String.valueOf(Object).
      抛出:
      X
    • checkTrue

      public static <X extends Throwable> void checkTrue(boolean b, Class<X> declareType, @Nullable String errorMessageTemplate, @Nullable Object p1) throws X
      执行表达式,为false时抛出 declareType 异常

      See checkTrue(boolean, Class, String, Object...) for details.

      抛出:
      X
    • checkNotNull

      public static <T, X extends Throwable> T checkNotNull(T reference, Class<X> declareType, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) throws X
      reference为null时抛出 declareType 异常
      类型参数:
      T - 对象类型
      X - 抛出异常类型
      参数:
      reference -
      declareType - 异常类型
      errorMessageTemplate - a template for the exception message should the check fail. The message is formed by replacing each %s placeholder in the template with an argument. These are matched by position - the first %s gets errorMessageArgs[0], etc. Unmatched arguments will be appended to the formatted message in square braces. Unmatched placeholders will be left as-is.
      errorMessageArgs - the arguments to be substituted into the message template. Arguments are converted to strings using String.valueOf(Object).
      返回:
      T instance
      抛出:
      X
    • checkNotNull

      public static <T, X extends Throwable> T checkNotNull(T reference, Class<X> declareType, @Nullable String errorMessageTemplate, @Nullable Object p1) throws X
      reference为null时抛出 declareType 异常

      See checkNotNull(Object, Class, String, Object...) for details.

      返回:
      T instance
      抛出:
      X