Enum Class ValidationMethodName

java.lang.Object
java.lang.Enum<ValidationMethodName>
com.broadleafcommerce.metadata.dsl.core.utils.ValidationMethodName
All Implemented Interfaces:
Serializable, Comparable<ValidationMethodName>, Constable

public enum ValidationMethodName extends Enum<ValidationMethodName>
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 Constants
    Enum Constant
    Description
    For 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 Type
    Method
    Description
    forMethodName(String methodName)
     
     
     
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • UPPERCASE

      public static final ValidationMethodName UPPERCASE
      For strings, converts the value to uppercase.
    • LOWERCASE

      public static final ValidationMethodName LOWERCASE
      For strings, converts the value to lowercase.
    • EMAIL

      public static final ValidationMethodName EMAIL
      For strings, validates that a field is a valid email.
    • REGEX

      public static final ValidationMethodName REGEX
      For strings, validates that a field matches a pattern. Requires an argument that is the regular expression to compare to.
    • MIN

      public static final ValidationMethodName 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

      public static final ValidationMethodName 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

      public static final ValidationMethodName POSITIVE
      For numbers and money, validates that a field is positive.
    • NEGATIVE

      public static final ValidationMethodName NEGATIVE
      For numbers and money, validates that a field is negative.
    • IS_AFTER

      public static final ValidationMethodName 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

      public static final ValidationMethodName 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

      public static final ValidationMethodName 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

      public static final ValidationMethodName 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

      public static final ValidationMethodName LESS_THAN
      For numbers, validates that a field is less than some value. Requires an argument with the value to compare to.
    • MORE_THAN

      public static final ValidationMethodName 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

      public static final ValidationMethodName URL_ABSOLUTE_OR_RELATIVE
      For strings, validates that a field is a valid absolute or relative URL.
    • URL_PATH

      public static final ValidationMethodName URL_PATH
      For strings, validates that a field is a valid relative URL.
    • INTEGER

      public static final ValidationMethodName INTEGER
      For numbers and money, validates that a field is an integer.
    • TRUNCATE

      public static final ValidationMethodName TRUNCATE
      For numbers and money, truncates the value of a field so that it is an integer.
    • ROUND

      public static final ValidationMethodName 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

      public static final ValidationMethodName TRIM
      For strings, removes trailing and leading whitespace from the value of a string.
    • ENSURE

      public static final ValidationMethodName ENSURE
      For strings, converts null and undefined values of fields to empty strings.
  • Method Details

    • values

      public static ValidationMethodName[] 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

      public static ValidationMethodName valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • forMethodName

      public static Optional<ValidationMethodName> forMethodName(String methodName)
    • getMethodName

      public String getMethodName()
    • getArgumentTypes

      public Set<Class<?>> getArgumentTypes()