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 java.lang.Enum
Enum.EnumDesc<E extends Enum<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.boolean
isEncrypted
(String value) Returnstrue
if the given value is considered encrypted by this implementation.static NoOpEncryption
Returns 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:Encryption
Encrypts the given plain-text value using the configured encryption algorithm and key.- Specified by:
encrypt
in interfaceEncryption
- Parameters:
value
- the plain-text value to encrypt- Returns:
- the encrypted form of the input value
-
decrypt
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 interfaceEncryption
- Parameters:
value
- the encrypted string to decrypt- Returns:
- the decrypted plain-text value
-
isEncrypted
Description copied from interface:Encryption
Returnstrue
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 interfaceEncryption
- Parameters:
value
- the value to check- Returns:
true
if the value appears to be encrypted,false
otherwise
-
getAlgorithm
Description copied from interface:Encryption
Returns the name or identifier of the encryption algorithm used.- Specified by:
getAlgorithm
in interfaceEncryption
- Returns:
- the name of the algorithm (e.g., "AES", "RSA", "noop")
-
getEncryptionKey
Description copied from interface:Encryption
Returns the encryption key used by this implementation.- Specified by:
getEncryptionKey
in interfaceEncryption
- Returns:
- the configured key for encryption/decryption, usually a secret or secret reference
-