Enum Class ProtectionMode

java.lang.Object
java.lang.Enum<ProtectionMode>
com.craftingdead.protect.ProtectionMode
All Implemented Interfaces:
Serializable, Comparable<ProtectionMode>, Constable

public enum ProtectionMode extends Enum<ProtectionMode>
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
  • Enum Constant Details

    • DEV

      public static final ProtectionMode DEV
      Development mode - minimal protection, allows debugging.
    • RELEASE

      public static final ProtectionMode RELEASE
      Release mode - full protection with strict enforcement.
  • Method Details

    • values

      public static ProtectionMode[] 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 ProtectionMode 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
    • current

      public static ProtectionMode 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

      public String getDescription()
      Gets a human-readable description of this mode.
      Returns:
      Description string
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ProtectionMode>