public class Assert extends Object
| Constructor and Description |
|---|
Assert() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fail(String message,
Object... params)
Always fails, throwing an IllegalArgument Exception.
|
static <T> T |
fail(Supplier<String> message,
Object... params)
Always fails, throwing an IllegalArgument Exception.
|
static void |
isFalse(boolean condition,
String message,
Object... params)
Asserts that a condition is false, throwing an IllegalArgumentException if not.
|
static void |
isFalse(boolean condition,
Supplier<String> message,
Object... params)
Asserts that a tested condition is false, throwing an IllegalArgumentException if not.
|
static void |
isNull(Object value,
String message,
Object... params)
Asserts that a value is null, throwing an IllegalArgumentException if not.
|
static void |
isNull(Object value,
Supplier<String> message,
Object... params)
Asserts that a value is null, throwing an IllegalArgumentException if not.
|
static void |
isTrue(boolean condition,
String message,
Object... params)
Asserts that a condition is true, throwing an IllegalArgumentException if not.
|
static void |
isTrue(boolean condition,
Supplier<String> message,
Object... params)
Asserts that a tested condition is true, throwing an IllegalArgumentException if not.
|
static void |
notNull(Object value,
String message,
Object... params)
Asserts that a value is not null, throwing an IllegalArgumentException if it is.
|
static void |
notNull(Object value,
Supplier<String> message,
Object... params)
Asserts that a value is not null, throwing an IllegalArgumentException if it is.
|
static void |
state(boolean state,
String message,
Object... params)
Asserts that a tested state is true, throwing an IllegalStateException if not.
|
static void |
state(boolean state,
Supplier<String> message,
Object... params)
Asserts that a tested state is true, throwing an IllegalStateException if not.
|
public static <T> T fail(String message, Object... params)
T - Pseudo return type to allow use as function.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - always thrown.public static <T> T fail(Supplier<String> message, Object... params)
T - Pseudo return type to allow use as function.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - always thrown.public static void isTrue(boolean condition,
String message,
Object... params)
condition - The condition to test.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if condition is false.public static void isTrue(boolean condition,
Supplier<String> message,
Object... params)
condition - The tested condition.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if condition is false.public static void isFalse(boolean condition,
String message,
Object... params)
condition - The condition to test.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if condition is true.public static void isFalse(boolean condition,
Supplier<String> message,
Object... params)
condition - The tested condition.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if condition is true.public static void isNull(Object value, String message, Object... params)
value - The value to check.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if value is not null.public static void isNull(Object value, Supplier<String> message, Object... params)
value - The value to check.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if value is not null.public static void notNull(Object value, String message, Object... params)
value - The value to check.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if value is null.public static void notNull(Object value, Supplier<String> message, Object... params)
value - The value to check.message - The exception message.params - Optional parameters if formatted message.IllegalArgumentException - if value is null.public static void state(boolean state,
String message,
Object... params)
state - The tested state.message - The exception message.params - Optional parameters if formatted message.IllegalStateException - if state is false.public static void state(boolean state,
Supplier<String> message,
Object... params)
state - The tested state.message - The exception message.params - Optional parameters if formatted message.IllegalStateException - if state is false.Copyright © 2023 Fujion Framework. All rights reserved.