Class ConstraintException

  • All Implemented Interfaces:
    Serializable

    public class ConstraintException
    extends RepositoryException
    Thrown when model data violate the rules with JSR Bean Validation
    Since:
    0.6.0
    Author:
    Alisson Gomes
    See Also:
    Serialized Form
    • Constructor Detail

      • ConstraintException

        public ConstraintException​(String param,
                                   String message)
        Constructor for ConstraintException without message detail
        Parameters:
        param - the name of parameter with error
        message - the user message
      • ConstraintException

        public ConstraintException​(Map<String,​String> violations)
        Constructor for ConstraintException with a set of messages
        Parameters:
        violations - violated constraints from model, with pair of values field and message
    • Method Detail

      • getViolations

        public Map<String,​String> getViolations()
        Map with violations where key is javax.validation.ConstraintViolation.getPropertyPath() name with violation message.
        Returns:
        set of violation messages from Bean Validation