Annotation Type Encrypted


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Encrypted
    Annotation to mark configuration keys that contain encrypted values.

    When a configuration key is marked with this annotation, ConfNG will automatically decrypt the value when it is retrieved.

    Example Usage:

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

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean failOnError
      Whether to fail if decryption fails.
      String provider
      The name of the encryption provider to use.
    • Element Detail

      • provider

        String provider
        The name of the encryption provider to use.

        If not specified, the default provider registered with ConfNG will be used.

        Returns:
        the provider name, or empty string for default
        Default:
        ""
      • failOnError

        boolean failOnError
        Whether to fail if decryption fails.

        If true (default), a decryption failure will throw an exception. If false, the original encrypted value will be returned.

        Returns:
        true to fail on decryption error
        Default:
        true