public final class AssertUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
require(boolean condition,
String message)
Checks that a condition is accepted and throws a customized
IllegalArgumentException if it is
not. |
static <T> T |
requireNonNull(T obj,
String message)
Checks that an object is not
null and throws a customized IllegalArgumentException if
it is. |
static String |
requireValidName(@Nullable String name,
String message)
Checks that a specified
String is not null or empty or backticks included and throws a
customized IllegalArgumentException if it is. |
public static <T> T requireNonNull(@Nullable
T obj,
String message)
null and throws a customized IllegalArgumentException if
it is.T - the type of the reference.obj - the object reference to check for nullity.message - the detail message to be used by thrown IllegalArgumentException.obj if not null.IllegalArgumentException - if obj is null.public static void require(boolean condition,
String message)
IllegalArgumentException if it is
not.condition - if condition accepted.message - the detail message to be used by thrown IllegalArgumentException.IllegalArgumentException - if condition is false.public static String requireValidName(@Nullable @Nullable String name, String message)
String is not null or empty or backticks included and throws a
customized IllegalArgumentException if it is.name - the String to check for nullity or empty or backticks included.message - the detail message to be used by thrown IllegalArgumentException.name if not null or empty or backticks included.IllegalArgumentException - if name is null or empty or backticks included.Copyright © 2018–2023 asyncer.io. All rights reserved.