public class Assert extends Object
| 构造器和说明 |
|---|
Assert() |
| 限定符和类型 | 方法和说明 |
|---|---|
static double |
checkBetween(double value,
double min,
double max) |
static int |
checkBetween(int value,
int min,
int max) |
static long |
checkBetween(long value,
long min,
long max) |
static Number |
checkBetween(Number value,
Number min,
Number max) |
static int |
checkIndex(int index,
int size) |
static int |
checkIndex(int index,
int size,
String errorMsgTemplate,
Object... params) |
static void |
isAssignable(Class<?> superType,
Class<?> subType) |
static void |
isAssignable(Class<?> superType,
Class<?> subType,
String errorMsgTemplate,
Object... params) |
static void |
isFalse(boolean expression) |
static void |
isFalse(boolean expression,
String errorMsgTemplate,
Object... params) |
static <T> T |
isInstanceOf(Class<?> type,
T obj) |
static <T> T |
isInstanceOf(Class<?> type,
T obj,
String errorMsgTemplate,
Object... params) |
static void |
isNull(Object object) |
static void |
isNull(Object object,
String errorMsgTemplate,
Object... params) |
static void |
isTrue(boolean expression) |
static void |
isTrue(boolean expression,
String errorMsgTemplate,
Object... params) |
static <T> T[] |
noNullElements(T[] array) |
static <T> T[] |
noNullElements(T[] array,
String errorMsgTemplate,
Object... params) |
static <T extends CharSequence> |
notBlank(T text) |
static <T extends CharSequence> |
notBlank(T text,
String errorMsgTemplate,
Object... params) |
static String |
notContain(String textToSearch,
String substring) |
static String |
notContain(String textToSearch,
String substring,
String errorMsgTemplate,
Object... params) |
static <T> Collection<T> |
notEmpty(Collection<T> collection) |
static <T> Collection<T> |
notEmpty(Collection<T> collection,
String errorMsgTemplate,
Object... params) |
static <K,V> Map<K,V> |
notEmpty(Map<K,V> map) |
static <K,V> Map<K,V> |
notEmpty(Map<K,V> map,
String errorMsgTemplate,
Object... params) |
static Object[] |
notEmpty(Object[] array) |
static Object[] |
notEmpty(Object[] array,
String errorMsgTemplate,
Object... params) |
static <T extends CharSequence> |
notEmpty(T text) |
static <T extends CharSequence> |
notEmpty(T text,
String errorMsgTemplate,
Object... params) |
static <T> T |
notNull(T object) |
static <T> T |
notNull(T object,
String errorMsgTemplate,
Object... params) |
static void |
state(boolean expression) |
static void |
state(boolean expression,
String errorMsgTemplate,
Object... params) |
public static void isTrue(boolean expression,
String errorMsgTemplate,
Object... params)
throws IllegalArgumentException
public static void isTrue(boolean expression)
throws IllegalArgumentException
public static void isFalse(boolean expression,
String errorMsgTemplate,
Object... params)
throws IllegalArgumentException
public static void isFalse(boolean expression)
throws IllegalArgumentException
public static void isNull(Object object, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static void isNull(Object object) throws IllegalArgumentException
public static <T> T notNull(T object,
String errorMsgTemplate,
Object... params)
throws IllegalArgumentException
public static <T> T notNull(T object)
throws IllegalArgumentException
public static <T extends CharSequence> T notEmpty(T text, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static <T extends CharSequence> T notEmpty(T text) throws IllegalArgumentException
public static <T extends CharSequence> T notBlank(T text, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static <T extends CharSequence> T notBlank(T text) throws IllegalArgumentException
public static String notContain(String textToSearch, String substring, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static String notContain(String textToSearch, String substring) throws IllegalArgumentException
public static Object[] notEmpty(Object[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static Object[] notEmpty(Object[] array) throws IllegalArgumentException
public static <T> T[] noNullElements(T[] array,
String errorMsgTemplate,
Object... params)
throws IllegalArgumentException
public static <T> T[] noNullElements(T[] array)
throws IllegalArgumentException
public static <T> Collection<T> notEmpty(Collection<T> collection, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static <T> Collection<T> notEmpty(Collection<T> collection) throws IllegalArgumentException
public static <K,V> Map<K,V> notEmpty(Map<K,V> map, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static <K,V> Map<K,V> notEmpty(Map<K,V> map) throws IllegalArgumentException
public static <T> T isInstanceOf(Class<?> type, T obj)
public static <T> T isInstanceOf(Class<?> type, T obj, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static void isAssignable(Class<?> superType, Class<?> subType) throws IllegalArgumentException
public static void isAssignable(Class<?> superType, Class<?> subType, String errorMsgTemplate, Object... params) throws IllegalArgumentException
public static void state(boolean expression,
String errorMsgTemplate,
Object... params)
throws IllegalStateException
public static void state(boolean expression)
throws IllegalStateException
public static int checkIndex(int index,
int size)
throws IllegalArgumentException,
IndexOutOfBoundsException
public static int checkIndex(int index,
int size,
String errorMsgTemplate,
Object... params)
throws IllegalArgumentException,
IndexOutOfBoundsException
public static int checkBetween(int value,
int min,
int max)
public static long checkBetween(long value,
long min,
long max)
public static double checkBetween(double value,
double min,
double max)
Copyright © 2020. All rights reserved.