Enum Class NoOpEncryption
- All Implemented Interfaces:
Encryption, Serializable, Comparable<NoOpEncryption>, Constable
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.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionDecrypts the given encrypted value.Encrypts the given plain-text value using the configured encryption algorithm and key.Returns the name or identifier of the encryption algorithm used.Returns the encryption key used by this implementation.booleanisEncrypted(String value) Returnstrueif the given value is considered encrypted by this implementation.static NoOpEncryptionReturns the enum constant of this class with the specified name.static NoOpEncryption[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
encrypt
Description copied from interface:EncryptionEncrypts the given plain-text value using the configured encryption algorithm and key.- Specified by:
encryptin interfaceEncryption- Parameters:
value- the plain-text value to encrypt- Returns:
- the encrypted form of the input value
-
decrypt
Description copied from interface:EncryptionDecrypts 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:
decryptin interfaceEncryption- Parameters:
value- the encrypted string to decrypt- Returns:
- the decrypted plain-text value
-
isEncrypted
Description copied from interface:EncryptionReturnstrueif the given value is considered encrypted by this implementation.Useful for avoiding double-encryption or determining if decryption is required.
- Specified by:
isEncryptedin interfaceEncryption- Parameters:
value- the value to check- Returns:
trueif the value appears to be encrypted,falseotherwise
-
getAlgorithm
Description copied from interface:EncryptionReturns the name or identifier of the encryption algorithm used.- Specified by:
getAlgorithmin interfaceEncryption- Returns:
- the name of the algorithm (e.g., "AES", "RSA", "noop")
-
getEncryptionKey
Description copied from interface:EncryptionReturns the encryption key used by this implementation.- Specified by:
getEncryptionKeyin interfaceEncryption- Returns:
- the configured key for encryption/decryption, usually a secret or secret reference
-