Class ValidationHelper
java.lang.Object
de.s42.base.validation.ValidationHelper
- Author:
- Benjamin Schiller
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic booleanisBooleanFalse(Object value) static booleanisBooleanTrue(Object value) static booleanstatic booleanisEmailAddress(String emailAddress) static booleanstatic booleanstatic booleanisGreaterEqual0(Object value) static booleanstatic booleanstatic booleanisMethodName(String methodName) static booleanisNotEmptyArray(Object value) static booleanstatic booleanstatic booleanisStringNotBlank(Object value) static booleanstatic booleanstatic booleanstatic booleanisUUIDLike(Object uuid) Tests if the given object is either a UUID or a string of form UUID or UUID58static voidisValid(boolean condition) This mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given messagestatic voidThis mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given messagestatic voidisValid(boolean condition, Supplier<? extends RuntimeException> exceptionSupplier) This mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given messagestatic booleanisVariableName(String variableName) static booleanisVariableNameOrNull(String variableName)
-
Field Details
-
EMAIL_PATTERN
-
VARIABLE_NAME_PATTERN
-
METHOD_NAME_PATTERN
-
-
Constructor Details
-
ValidationHelper
private ValidationHelper()
-
-
Method Details
-
isValid
public static void isValid(boolean condition, Supplier<? extends RuntimeException> exceptionSupplier) throws RuntimeException This mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given message- Parameters:
condition-exceptionSupplier-- Throws:
IllegalArgumentExceptionRuntimeException
-
isValid
This mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given message- Parameters:
condition-message-- Throws:
IllegalArgumentException
-
isValid
This mesthod allows to check for validity of a condition - otherwise throws a IllegalArgumentException with the given message- Parameters:
condition-- Throws:
IllegalArgumentException
-
isEmailAddress
-
isMethodName
-
isVariableName
-
isVariableNameOrNull
-
isTypeOf
-
isString
-
isStringNotBlank
-
isUUID
-
isUUIDLike
Tests if the given object is either a UUID or a string of form UUID or UUID58- Parameters:
uuid-- Returns:
-
isURL
-
isFloat
-
isDouble
-
isBoolean
-
isBooleanTrue
-
isBooleanFalse
-
isArray
-
isNotEmptyArray
-
isInteger
-
isNumber
-
isGreaterEqual0
-
isLong
-
isEqual
-