public final class AssertUtil extends Object
| 构造器和说明 |
|---|
AssertUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
exists(File file)
检查文件是否存在
|
static void |
notNull(Object o,
String msg)
断言对象不能为空
|
static void |
notNullOrEmpty(String o,
String msg)
检查string非空
|
static void |
withinRange(int min,
int max,
int value,
String msg)
检查给定int值是否在限定范围内
|
static void |
withinRange(long min,
long max,
long value,
String msg)
检查给定int值是否在限定范围内
|
public static void withinRange(int min,
int max,
int value,
String msg)
min - 最小值max - 最大值value - 要检查的值msg - 自定义异常信息public static void withinRange(long min,
long max,
long value,
String msg)
min - 最小值max - 最大值value - 要检查的值msg - 自定义异常信息public static void exists(File file) throws FileNotFoundException
Copyright © 2022. All rights reserved.