Enum Class ValidationMethodName
java.lang.Object
java.lang.Enum<ValidationMethodName>
com.broadleafcommerce.metadata.dsl.core.utils.ValidationMethodName
- All Implemented Interfaces:
Serializable
,Comparable<ValidationMethodName>
,Constable
Defines the out-of-box validation method names supported for metadata fields.
- Author:
- Nathan Moore (nathandmoore)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFor strings, validates that a field is a valid email.For strings, converts null and undefined values of fields to empty strings.For numbers and money, validates that a field is an integer.For dates, validates that a field is after the value of another date field.For numbers, compares that a field is at least the value of another field or null.For dates, validates that a field is before the value of another date field.For dates, validates that a field is between the values of two other date fields.For numbers, validates that a field is less than some value.For strings, converts the value to lowercase.For strings, validates that a field's length is less than a value.For strings, validates that a field's length is more than a value.For numbers, validates that a field is more than some value.For numbers and money, validates that a field is negative.For numbers and money, validates that a field is positive.For strings, validates that a field matches a pattern.For numbers and money, performs a rounding operation on the value of a field.For strings, removes trailing and leading whitespace from the value of a string.For numbers and money, truncates the value of a field so that it is an integer.For strings, converts the value to uppercase.For strings, validates that a field is a valid absolute or relative URL.For strings, validates that a field is a valid relative URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ValidationMethodName>
forMethodName
(String methodName) static ValidationMethodName
Returns the enum constant of this class with the specified name.static ValidationMethodName[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UPPERCASE
For strings, converts the value to uppercase. -
LOWERCASE
For strings, converts the value to lowercase. -
EMAIL
For strings, validates that a field is a valid email. -
REGEX
For strings, validates that a field matches a pattern. Requires an argument that is the regular expression to compare to. -
MIN
For strings, validates that a field's length is more than a value. Requires an argument with the value to compare to.For numbers and money, validates that a field's value is more than a value.
-
MAX
For strings, validates that a field's length is less than a value. Requires an argument with the value to compare to.For numbers and money, validates that a field's value is less than a value.
-
POSITIVE
For numbers and money, validates that a field is positive. -
NEGATIVE
For numbers and money, validates that a field is negative. -
IS_AFTER
For dates, validates that a field is after the value of another date field. Requires an argument that is the path to the other field to compare to. -
IS_BEFORE
For dates, validates that a field is before the value of another date field. Requires an argument that is the path to the other field to compare to. -
IS_BETWEEN
For dates, validates that a field is between the values of two other date fields. Requires two arguments that are the paths to the other fields to compare to. -
IS_AT_LEAST
For numbers, compares that a field is at least the value of another field or null. Requires an argument that is the path to the field to compare to. -
LESS_THAN
For numbers, validates that a field is less than some value. Requires an argument with the value to compare to. -
MORE_THAN
For numbers, validates that a field is more than some value. Requires an argument with the value to compare to. -
URL_ABSOLUTE_OR_RELATIVE
For strings, validates that a field is a valid absolute or relative URL. -
URL_PATH
For strings, validates that a field is a valid relative URL. -
INTEGER
For numbers and money, validates that a field is an integer. -
TRUNCATE
For numbers and money, truncates the value of a field so that it is an integer. -
ROUND
For numbers and money, performs a rounding operation on the value of a field. Requires an argument specify the rounding method. Possible values are'floor' | 'ceil' | 'trunc' | 'round'
. Default is'round'
. All methods are part of the JavaScript Math API. -
TRIM
For strings, removes trailing and leading whitespace from the value of a string. -
ENSURE
For strings, converts null and undefined values of fields to empty strings.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
forMethodName
-
getMethodName
-
getArgumentTypes
-