public final class RequestValidations
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
checkBindValueSet(java.nio.ByteBuffer b,
java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Checks that the specified bind marker value is set to a meaningful value.
|
static void |
checkContainsNoDuplicates(java.util.List<?> list,
java.lang.String message)
Checks that the specified list does not contains duplicates.
|
static <E> void |
checkContainsOnly(java.util.List<E> list,
java.util.List<E> expectedElements,
java.lang.String message)
Checks that the specified list contains only the specified elements.
|
static void |
checkFalse(boolean expression,
java.lang.String message)
Checks that the specified expression is
false . |
static void |
checkFalse(boolean expression,
java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Checks that the specified expression is
false . |
static <T> T |
checkNotNull(T object,
java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Checks that the specified object is NOT
null . |
static <T> T |
checkNull(T object,
java.lang.String message)
Checks that the specified object is
null . |
static <T> T |
checkNull(T object,
java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Checks that the specified object is
null . |
static void |
checkTrue(boolean expression,
java.lang.String message)
Checks that the specified expression is
true . |
static void |
checkTrue(boolean expression,
java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Checks that the specified expression is
true . |
static InvalidRequestException |
invalidRequest(java.lang.String messageTemplate,
java.lang.Object... messageArgs)
Returns an
InvalidRequestException with the specified message. |
public static void checkTrue(boolean expression, java.lang.String message) throws InvalidRequestException
true
. If not an InvalidRequestException
will
be thrown.expression
- the expression to testmessage
- the error messageInvalidRequestException
- if the specified expression is false
.public static void checkTrue(boolean expression, java.lang.String messageTemplate, java.lang.Object... messageArgs) throws InvalidRequestException
true
. If not an InvalidRequestException
will
be thrown.expression
- the expression to testmessageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
- if the specified expression is false
.public static void checkContainsNoDuplicates(java.util.List<?> list, java.lang.String message) throws InvalidRequestException
list
- the list to testmessage
- the error messageInvalidRequestException
- if the specified list contains duplicates.public static <E> void checkContainsOnly(java.util.List<E> list, java.util.List<E> expectedElements, java.lang.String message) throws InvalidRequestException
list
- the list to testexpectedElements
- the expected elementsmessage
- the error messageInvalidRequestException
- if the specified list contains duplicates.public static void checkFalse(boolean expression, java.lang.String messageTemplate, java.lang.Object... messageArgs) throws InvalidRequestException
false
. If not an InvalidRequestException
will
be thrown.expression
- the expression to testmessageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
- if the specified expression is true
.public static void checkFalse(boolean expression, java.lang.String message) throws InvalidRequestException
false
. If not an InvalidRequestException
will
be thrown.expression
- the expression to testmessage
- the error messageInvalidRequestException
- if the specified expression is true
.public static <T> T checkNotNull(T object, java.lang.String messageTemplate, java.lang.Object... messageArgs) throws InvalidRequestException
null
.
If it is an InvalidRequestException
will be throws.object
- the object to testmessageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
- if the specified object is null
.public static void checkBindValueSet(java.nio.ByteBuffer b, java.lang.String messageTemplate, java.lang.Object... messageArgs) throws InvalidRequestException
InvalidRequestException
will be thrown.b
- the ByteBuffer
to testmessageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
- if the specified bind marker value is not set to a meaningful value.public static <T> T checkNull(T object, java.lang.String messageTemplate, java.lang.Object... messageArgs) throws InvalidRequestException
null
.
If it is not an InvalidRequestException
will be throws.object
- the object to testmessageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
- if the specified object is not null
.public static <T> T checkNull(T object, java.lang.String message) throws InvalidRequestException
null
.
If it is not an InvalidRequestException
will be throws.object
- the object to testmessage
- the error messageInvalidRequestException
- if the specified object is not null
.public static InvalidRequestException invalidRequest(java.lang.String messageTemplate, java.lang.Object... messageArgs)
InvalidRequestException
with the specified message.messageTemplate
- the template used to build the error messagemessageArgs
- the message argumentsInvalidRequestException
with the specified message.Copyright © 2016 The Apache Software Foundation