Enum Class NoOpEncryption

java.lang.Object
java.lang.Enum<NoOpEncryption>
io.fluxcapacitor.common.encryption.NoOpEncryption
All Implemented Interfaces:
Encryption, Serializable, Comparable<NoOpEncryption>, Constable

public enum NoOpEncryption extends Enum<NoOpEncryption> implements Encryption
A no-op implementation of the Encryption interface that performs no actual encryption or decryption.

This implementation simply returns the input value as-is, making it useful for testing, debugging, or development environments where encryption is unnecessary or intentionally disabled.

Usage Note:

This class should never be used in production systems where encryption or data confidentiality is required.
  • Enum Constant Details

  • Method Details

    • values

      public static NoOpEncryption[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NoOpEncryption valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • encrypt

      public String encrypt(String value)
      Description copied from interface: Encryption
      Encrypts the given plain-text value using the configured encryption algorithm and key.
      Specified by:
      encrypt in interface Encryption
      Parameters:
      value - the plain-text value to encrypt
      Returns:
      the encrypted form of the input value
    • decrypt

      public String decrypt(String value)
      Description copied from interface: Encryption
      Decrypts the given encrypted value.

      This method assumes that the input is a properly formatted encrypted value produced by the corresponding Encryption.encrypt(String) method.

      Specified by:
      decrypt in interface Encryption
      Parameters:
      value - the encrypted string to decrypt
      Returns:
      the decrypted plain-text value
    • isEncrypted

      public boolean isEncrypted(String value)
      Description copied from interface: Encryption
      Returns true if the given value is considered encrypted by this implementation.

      Useful for avoiding double-encryption or determining if decryption is required.

      Specified by:
      isEncrypted in interface Encryption
      Parameters:
      value - the value to check
      Returns:
      true if the value appears to be encrypted, false otherwise
    • getAlgorithm

      public String getAlgorithm()
      Description copied from interface: Encryption
      Returns the name or identifier of the encryption algorithm used.
      Specified by:
      getAlgorithm in interface Encryption
      Returns:
      the name of the algorithm (e.g., "AES", "RSA", "noop")
    • getEncryptionKey

      public String getEncryptionKey()
      Description copied from interface: Encryption
      Returns the encryption key used by this implementation.
      Specified by:
      getEncryptionKey in interface Encryption
      Returns:
      the configured key for encryption/decryption, usually a secret or secret reference