Enum ValidateType

    • Method Detail

      • values

        public static ValidateType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ValidateType c : ValidateType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ValidateType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getValidateGroup

        public abstract Class<?> getValidateGroup()
      • get

        public static ValidateType get​(String type)
        Parameters:
        type - of validate
        Returns:
        enum with valueof type, ValidateType.NONE if doesn't match
      • assertValidate

        public void assertValidate​(Object params)
        Use validator (JSR 303) to perform validation against domain model, when some constraint is violated ConstraintException is throw
        Parameters:
        params - the domain model to validate
        Throws:
        ConstraintException - when some constraint is violated
      • validate

        public Map<String,​String> validate​(Object params)
        Use validator (JSR 303) to perform validation against domain model
        Parameters:
        params - the domain model to validate
        Returns:
        the pairs field and constraints violated, an empty Map is return when any constraint is violated
      • assertValidate

        public static void assertValidate​(Object params,
                                          ValidateType validateType)
        Use validator (JSR 303) to perform validation against domain model
        Parameters:
        params - the domain model to validate
        validateType - type of validation
        Throws:
        ConstraintException - when some constraint is violated
      • assertValidate

        public static <T> void assertValidate​(Object params,
                                              Class<T> validateGroup)
        Use validator (JSR 303) to perform validation against domain model
        Parameters:
        params - the domain model to validate
        validateGroup - type of validation
        Throws:
        ConstraintException - when some constraint is violated
      • validate

        public static Map<String,​String> validate​(Object params,
                                                        ValidateType validateType)
        Use validator (JSR 303) to perform validation against domain model
        Parameters:
        params - the domain model to validate
        validateType - type of validation
        Returns:
        the pairs field and constraints violated, an empty Map is return when any constraint is violated
      • validate

        public static <T> Map<String,​String> validate​(Object params,
                                                            Class<T> validateGroup)
        Use validator (JSR 303) to perform validation against domain model
        Parameters:
        params - the domain model to validate
        validateGroup - type of validation
        Returns:
        the pairs field and constraints violated, an empty Map is return when any constraint is violated