Annotation Type Pattern


  • @Documented
    @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Pattern
    Validates that a configuration value matches a regular expression pattern.

    When applied to a ConfNGKey enum constant, validation will fail if the configuration value does not match the specified regex pattern.

    Example usage:

    {@code
     public enum MyConfig implements ConfNGKey {
    Since:
    1.1.0
    Author:
    Bharat Kumar Malviya, GitHub: github.com/imBharatMalviya
    See Also:
    ConfigValidator
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String regex
      The regular expression pattern to match against.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String message
      Custom error message to use when validation fails.
    • Element Detail

      • regex

        String regex
        The regular expression pattern to match against.
        Returns:
        the regex pattern
      • message

        String message
        Custom error message to use when validation fails. If empty, a default message will be generated.
        Returns:
        the custom error message
        Default:
        ""