public class Asserts extends Object
Asserts tool class.
| 构造器和说明 |
|---|
Asserts() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
isEmpty(Object object,
String message,
Object... args)
Asserts that the object is empty, otherwise throw an exception.
|
static void |
isEmpty(Object object,
Supplier<RuntimeException> ex)
Asserts that the object is empty, otherwise throw an exception.
|
static void |
isEquals(Object obj1,
Object obj2,
String message,
Object... args)
Asserts that the obj1 is equals obj2, otherwise throw an exception.
|
static void |
isEquals(Object obj1,
Object obj2,
Supplier<RuntimeException> ex)
Asserts that the obj1 is equals obj2, otherwise throw an exception.
|
static void |
isFalse(boolean expression,
String message,
Object... args)
Asserts that the expression is false, otherwise throw an exception.
|
static void |
isFalse(boolean expression,
Supplier<RuntimeException> ex)
Asserts that the expression is false, otherwise throw an exception.
|
static void |
isNotEmpty(Object object,
String message,
Object... args)
Asserts that the object not empty, otherwise throw an exception.
|
static void |
isNotEmpty(Object object,
Supplier<RuntimeException> ex)
Asserts that the object not empty, otherwise throw an exception.
|
static void |
isNotEquals(Object obj1,
Object obj2,
String message,
Object... args)
Asserts that the obj1 is not equals obj2, otherwise throw an exception.
|
static void |
isNotEquals(Object obj1,
Object obj2,
Supplier<RuntimeException> ex)
Asserts that the obj1 is not equals obj2, otherwise throw an exception.
|
static void |
isNotNull(Object object,
String message,
Object... args)
Asserts that the object is null, otherwise throw an exception.
|
static void |
isNotNull(Object object,
Supplier<RuntimeException> ex)
Asserts that the object is null, otherwise throw an exception.
|
static void |
isNull(Object object,
String message,
Object... args)
Asserts that the object is null, otherwise throw an exception.
|
static void |
isNull(Object object,
Supplier<RuntimeException> ex)
Asserts that the object is null, otherwise throw an exception.
|
static void |
isTrue(boolean expression,
String message,
Object... args)
Asserts that the expression is true, otherwise throw an exception.
|
static void |
isTrue(boolean expression,
Supplier<RuntimeException> ex)
Asserts that the expression is true, otherwise throw an exception.
|
public static void isEquals(Object obj1, Object obj2, Supplier<RuntimeException> ex)
Asserts that the obj1 is equals obj2, otherwise throw an exception.
obj1 - obj1obj2 - obj2ex - exception supplierpublic static void isEquals(Object obj1, Object obj2, String message, Object... args)
Asserts that the obj1 is equals obj2, otherwise throw an exception.
obj1 - obj1obj2 - obj2message - exception messageargs - exception message argumentspublic static void isNotEquals(Object obj1, Object obj2, Supplier<RuntimeException> ex)
Asserts that the obj1 is not equals obj2, otherwise throw an exception.
obj1 - obj1obj2 - obj2ex - exception supplierpublic static void isNotEquals(Object obj1, Object obj2, String message, Object... args)
Asserts that the obj1 is not equals obj2, otherwise throw an exception.
obj1 - obj1obj2 - obj2message - exception messageargs - exception message argumentspublic static void isTrue(boolean expression,
Supplier<RuntimeException> ex)
Asserts that the expression is true, otherwise throw an exception.
expression - expressionex - exception supplierpublic static void isTrue(boolean expression,
String message,
Object... args)
Asserts that the expression is true, otherwise throw an exception.
expression - expressionmessage - exception messageargs - exception message argumentspublic static void isFalse(boolean expression,
Supplier<RuntimeException> ex)
Asserts that the expression is false, otherwise throw an exception.
expression - expressionex - exception supplierpublic static void isFalse(boolean expression,
String message,
Object... args)
Asserts that the expression is false, otherwise throw an exception.
expression - expressionmessage - exception messageargs - exception message argumentspublic static void isNotEmpty(Object object, Supplier<RuntimeException> ex)
Asserts that the object not empty, otherwise throw an exception.
object - objectex - exception supplierpublic static void isNotEmpty(Object object, String message, Object... args)
Asserts that the object not empty, otherwise throw an exception.
object - objectmessage - exception messageargs - exception message argumentspublic static void isEmpty(Object object, Supplier<RuntimeException> ex)
Asserts that the object is empty, otherwise throw an exception.
object - objectex - exception supplierpublic static void isEmpty(Object object, String message, Object... args)
Asserts that the object is empty, otherwise throw an exception.
object - objectmessage - exception messageargs - exception message argumentspublic static void isNotNull(Object object, Supplier<RuntimeException> ex)
Asserts that the object is null, otherwise throw an exception.
object - objectex - exception supplierpublic static void isNotNull(Object object, String message, Object... args)
Asserts that the object is null, otherwise throw an exception.
object - objectmessage - exception messageargs - exception message argumentspublic static void isNull(Object object, Supplier<RuntimeException> ex)
Asserts that the object is null, otherwise throw an exception.
object - objectex - exception supplierCopyright © 2024. All rights reserved.