Package com.craftingdead.protect
Enum Class ProtectionMode
- All Implemented Interfaces:
Serializable,Comparable<ProtectionMode>,Constable
Represents the protection mode for the application.
DEV mode: Minimal protection, allows debugging and profiling.
RELEASE mode: Full protection, stricter enforcement of security checks.
The mode is controlled via the JVM property: -Dcd.protectionMode=dev|release
-
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 TypeMethodDescriptionstatic ProtectionModecurrent()Gets the current protection mode based on system property.Gets a human-readable description of this mode.static booleanisDev()Checks if the current mode is DEV.static booleanChecks if the current mode is RELEASE.toString()static ProtectionModeReturns the enum constant of this class with the specified name.static ProtectionMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEV
Development mode - minimal protection, allows debugging. -
RELEASE
Release mode - full protection with strict enforcement.
-
-
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
-
current
Gets the current protection mode based on system property.- Returns:
- The current protection mode (defaults to DEV if not specified)
-
isDev
public static boolean isDev()Checks if the current mode is DEV.- Returns:
- true if running in development mode
-
isRelease
public static boolean isRelease()Checks if the current mode is RELEASE.- Returns:
- true if running in release mode
-
getDescription
Gets a human-readable description of this mode.- Returns:
- Description string
-
toString
- Overrides:
toStringin classEnum<ProtectionMode>
-