public class StringValidationsWithErrorCode extends Object
| Modifier and Type | Method and Description |
|---|---|
static Validation<String> |
contains(String contained,
String errorCode)
creates a validation which validates if a string contains an expected text.
|
static Validation<String> |
contains(java.util.function.Supplier<String> contained,
String errorCode)
creates a validation which validates if a string contains an expected text.
|
static Validation<String> |
containsNotOnly(String containedValue,
String errorCode)
creates a validation which validates if a string contains not only an expected text.
|
static Validation<String> |
containsNotOnly(java.util.function.Supplier<String> containedValue,
String errorCode)
creates a validation which validates if a string contains not only an expected text.
|
static Validation<String> |
hasLength(int length,
String errorCode)
creates a validation which validates if a string length is equal to the provided size length argument.
|
static Validation<String> |
hasLength(java.util.function.Supplier<Integer> length,
String errorCode)
creates a validation which validates if a string length is equal to the provided size length argument.
|
static Validation<String> |
isDate(java.time.format.DateTimeFormatter formatter,
String errorCode)
creates a validation which validates that a string can be parsed to a date.
|
static Validation<String> |
isDate(java.util.function.Supplier<java.time.format.DateTimeFormatter> formatter,
String errorCode)
creates a validation which validates that a string can be parsed to a date.
|
static Validation<String> |
isInArray(java.util.function.Supplier<String[]> validValueSupplier,
String errorCode)
creates a validation which validates that a string is in a list of valid values.
|
static Validation<String> |
isInList(java.util.function.Supplier<Collection<String>> validValueSupplier,
String errorCode)
creates a validation which validates that a string is in a list of valid values
|
static Validation<String> |
isNotBlank(String errorCode)
creates a validation which validates that a string is not blank(see StringUtils of apache commons)
|
static Validation<String> |
isNumeric(String errorCode)
creates a validation which validates if a string is numeric.
|
static Validation<String> |
lengthIsBetween(int minSize,
int maxSize,
String errorCode)
creates a validation which validates if a string length is between the provided size arguments.
|
static Validation<String> |
lengthIsBetween(java.util.function.Supplier<Integer> minSize,
java.util.function.Supplier<Integer> maxSize,
String errorCode)
creates a validation which validates if a string length is between the provided size arguments.
|
static Validation<String> |
lengthIsLessThan(int size,
String errorCode)
creates a validation which validates that a string length is less than the provided size argument.
|
static Validation<String> |
lengthIsLessThan(java.util.function.Supplier<Integer> size,
String errorCode)
creates a validation which validates that a string length is less than the provided size argument.
|
static Validation<String> |
lengthIsMoreThan(int size,
String errorCode)
create a validation which validates that a string has a length more than the provided size argument.
|
static Validation<String> |
lengthIsMoreThan(java.util.function.Supplier<Integer> size,
String errorCode)
create a validation which validates that a string has a length more than the provided size argument.
|
public static Validation<String> lengthIsMoreThan(int size, String errorCode)
size - string length is compared to that value and must be greatererrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> lengthIsMoreThan(java.util.function.Supplier<Integer> size, String errorCode)
size - string length is compared to that value and must be greatererrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> lengthIsLessThan(int size, String errorCode)
size - string length is compared to that value and must be lesserrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> lengthIsLessThan(java.util.function.Supplier<Integer> size, String errorCode)
size - string length is compared to that value and must be lesserrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> lengthIsBetween(int minSize, int maxSize, String errorCode)
minSize - the minimum size of the stringmaxSize - the maximum size of the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> lengthIsBetween(java.util.function.Supplier<Integer> minSize, java.util.function.Supplier<Integer> maxSize, String errorCode)
minSize - the minimum size of the stringmaxSize - the maximum size of the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> hasLength(int length, String errorCode)
length - the expected length of the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> hasLength(java.util.function.Supplier<Integer> length, String errorCode)
length - the expected length of the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> contains(String contained, String errorCode)
contained - the text which is expected somewhere in the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> contains(java.util.function.Supplier<String> contained, String errorCode)
contained - the text which is expected somewhere in the stringerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isNotBlank(String errorCode)
errorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isInArray(java.util.function.Supplier<String[]> validValueSupplier, String errorCode)
validValueSupplier - supplier for the list of valid valueserrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isInList(java.util.function.Supplier<Collection<String>> validValueSupplier, String errorCode)
validValueSupplier - supplier for the list of valid valueserrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isDate(java.time.format.DateTimeFormatter formatter, String errorCode)
formatter - the formatter used to parse the dateerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isDate(java.util.function.Supplier<java.time.format.DateTimeFormatter> formatter, String errorCode)
formatter - the formatter used to parse the dateerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> isNumeric(String errorCode)
errorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> containsNotOnly(String containedValue, String errorCode)
containedValue - is used to validate if the string contains only this texterrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<String> containsNotOnly(java.util.function.Supplier<String> containedValue, String errorCode)
containedValue - is used to validate if the string contains only this texterrorCode - in the case the validation violates this code is reported in the resultCopyright © 2018. All rights reserved.