Class AbstractConstraint

    • Constructor Detail

      • AbstractConstraint

        public AbstractConstraint()
    • Method Detail

      • getMessageKey

        public String getMessageKey()
        Description copied from interface: Constraint
        Provides the message key.
        Specified by:
        getMessageKey in interface Constraint
        Returns:
        The message key
      • getErrorMessage

        public String getErrorMessage​(Object invalidValue,
                                      Locale locale)
        Description copied from interface: Constraint
        Provides an error message to display when some invalid value does not match existing entity.
        Specified by:
        getErrorMessage in interface Constraint
        Parameters:
        invalidValue - The invalid value that don't match any entity.
        locale - The language in which the message should be generated.
        Returns:
        A message in the specified language or
      • getMessageString

        public static String getMessageString​(String bundleName,
                                              String key,
                                              Object[] params,
                                              Locale locale)
        Try to get the message from the given message bundle. If the bundle is not found or the key is not found, return null.
        Since:
        7.2