@ApiStatus.Internal
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion="2.0.0")
public final class Validate
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
isNotEmpty(java.lang.String string)
Deprecated.
Validates that the specified string is
not null and not empty.
|
static java.lang.String |
isNotEmpty(java.lang.String string,
java.lang.String message,
java.lang.Object... parameters)
Deprecated.
Validates that the specified string is
not null and not empty.
|
static <T> T |
isNotNull(T object)
Deprecated.
Validates that the provided object isn't null,
if it is, the method throws an
NullPointerException |
static <T> T |
isNotNull(T object,
java.lang.String message,
java.lang.Object... parameters)
Deprecated.
Validates that the provided object isn't null,
if it is, the method throws an
NullPointerException
with the specified message. |
static void |
isState(boolean expression)
Deprecated.
Validates that the specified expression is true,
if it is false, the method throws a
IllegalStateException |
static void |
isState(boolean expression,
java.lang.String message,
java.lang.Object... parameters)
Deprecated.
Validates that the specified expression is true,
if it is false, the method throws a
IllegalStateException
with the specified message. |
static void |
isTrue(boolean expression)
Deprecated.
Validates that the specified expression is true,
if it is false, the method throws a
IllegalArgumentException |
static void |
isTrue(boolean expression,
java.lang.String message,
java.lang.Object... parameters)
Deprecated.
Validates that the specified expression is true,
if it is false, the method throws a
IllegalArgumentException
with the specified message |
public static <T> T isNotNull(T object,
java.lang.String message,
java.lang.Object... parameters)
NullPointerException
with the specified message.T - The type of the checked objectobject - The checked objectmessage - The exception messageparameters - Parameters for the message,
message is formatted using
String.format(java.lang.String, java.lang.Object...).java.lang.NullPointerException - if object is nullpublic static <T> T isNotNull(T object)
NullPointerExceptionT - The type of the checked objectobject - The checked objectjava.lang.NullPointerException - if object is nullpublic static void isState(boolean expression,
java.lang.String message,
java.lang.Object... parameters)
IllegalStateException
with the specified message.expression - The checked expressionmessage - The message for the thrown exceptionparameters - The parameters for the exception
message. The message is formatted
using String.format(java.lang.String, java.lang.Object...).java.lang.IllegalStateException - If expression is falsepublic static void isState(boolean expression)
IllegalStateExceptionexpression - The checked expressionjava.lang.IllegalStateException - If expression is falsepublic static void isTrue(boolean expression,
java.lang.String message,
java.lang.Object... parameters)
IllegalArgumentException
with the specified messageexpression - The checked expressionmessage - The message for the thrown exceptionparameters - The parameters for the exception
message. The message is formatted
using String.format(java.lang.String, java.lang.Object...).java.lang.IllegalArgumentException - If expression is falsepublic static void isTrue(boolean expression)
IllegalArgumentExceptionexpression - The checked expressionjava.lang.IllegalArgumentException - If expression is falsepublic static java.lang.String isNotEmpty(java.lang.String string,
java.lang.String message,
java.lang.Object... parameters)
NullPointerException,
if the string is empty, throws a
IllegalArgumentException.string - The checked stringmessage - The message used for the messagesparameters - The parameters for the exception
message. The message is formatted
using String.format(java.lang.String, java.lang.Object...).java.lang.NullPointerException - if the string is nulljava.lang.IllegalArgumentException - If the string is emptypublic static java.lang.String isNotEmpty(java.lang.String string)
NullPointerException,
if the string is empty, throws a
IllegalArgumentException.string - The checked stringjava.lang.NullPointerException - if the string is nulljava.lang.IllegalArgumentException - If the string is empty