Class ConstraintCheckIssue

java.lang.Object
org.hibernate.validator.ap.internal.checks.ConstraintCheckIssue

public class ConstraintCheckIssue extends Object
The result of the execution of a ConstraintCheck. Comprises information about the location at which the issue occurred and a message describing the occurred issue.
Author:
Gunnar Morling
  • Constructor Details

    • ConstraintCheckIssue

      public ConstraintCheckIssue(Element element, AnnotationMirror annotationMirror, ConstraintCheckIssue.IssueKind kind, String messageKey, Object... messageParameters)
      Creates a new ConstraintCheckIssue.
      Parameters:
      element - The element at which the error occurred.
      annotationMirror - The annotation that causes the error.
      messageKey - A key for retrieving an error message template from the bundle

      org.hibernate.validator.ap.ValidationProcessorMessages.

      messageParameters - An array with values to put into the error message template using MessageFormat. The number of elements must match the number of place holders in the message template.
  • Method Details

    • getElement

      public Element getElement()
    • getAnnotationMirror

      public AnnotationMirror getAnnotationMirror()
    • getKind

    • getMessageKey

      public String getMessageKey()
    • getMessageParameters

      public Object[] getMessageParameters()
    • isError

      public boolean isError()
      Determine if issue is an error
      Returns:
      true if getKind() equals to ConstraintCheckIssue.IssueKind.ERROR
    • isWarning

      public boolean isWarning()
      Determine if issue is a warning
      Returns:
      true if getKind() equals to ConstraintCheckIssue.IssueKind.WARNING
    • error

      public static ConstraintCheckIssue error(Element element, AnnotationMirror annotationMirror, String messageKey, Object... messageParameters)
      Creates a new ConstraintCheckIssue of error kind (ConstraintCheckIssue.IssueKind.ERROR).
      Parameters:
      element - The element at which the error occurred.
      annotationMirror - The annotation that causes the error.
      messageKey - A key for retrieving an error message template from the bundle

      org.hibernate.validator.ap.ValidationProcessorMessages.

      messageParameters - An array with values to put into the error message template using MessageFormat. The number of elements must match the number of place holders in the message template.
    • warning

      public static ConstraintCheckIssue warning(Element element, AnnotationMirror annotationMirror, String messageKey, Object... messageParameters)
      Creates a new ConstraintCheckIssue of warning kind (ConstraintCheckIssue.IssueKind.WARNING).
      Parameters:
      element - The element at which the error occurred.
      annotationMirror - The annotation that causes the error.
      messageKey - A key for retrieving an error message template from the bundle

      org.hibernate.validator.ap.ValidationProcessorMessages.

      messageParameters - An array with values to put into the error message template using MessageFormat. The number of elements must match the number of place holders in the message template.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object