public class ExceptionUtils extends Object
| 构造器和说明 |
|---|
ExceptionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
checkArgument(boolean expression,
ErrorCode errorCode)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean expression,
ErrorCode errorCode,
Object errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkIdentifier(org.joyqueue.model.domain.Identifier identifier,
int maxLength)
Ensures input is an identifier and its length less than or equal maxLength
|
static void |
checkIdentifier(String input,
int maxLength)
Ensures input is an identifier and its length less than or equal maxLength
|
static void |
checkIdentifier(String input,
int maxLength,
String field)
Ensures input is an identifier and its length less than or equal maxLength
|
static void |
checkState(boolean expression,
Object errorMessage)
Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
|
public static void checkArgument(boolean expression,
ErrorCode errorCode)
expression - a boolean expressionerrorCode - the errorCode to use if the check failsConfigException - if expression is falseErrorCodepublic static void checkArgument(boolean expression,
ErrorCode errorCode,
Object errorMessage)
expression - a boolean expressionerrorCode - the errorCode to use if the check failserrorMessage - the exception message to use if the check fails; will be converted to a
string using String.valueOf(Object)ConfigException - if expression is falseErrorCodepublic static void checkState(boolean expression,
Object errorMessage)
expression - a boolean expressionerrorMessage - the exception message to use if the check fails; will be converted to a
string using String.valueOf(Object)IllegalStateException - if expression is falsepublic static void checkIdentifier(String input, int maxLength, String field)
input - maxLength - IdentifierException - if input is not identifierpublic static void checkIdentifier(String input, int maxLength)
input - maxLength - IdentifierException - if input is not identifierpublic static void checkIdentifier(org.joyqueue.model.domain.Identifier identifier,
int maxLength)
identifier - maxLength - IdentifierException - if input is not identifierCopyright © 2020 Joyqueue Community. All rights reserved.