Enum Class DevelopMode

java.lang.Object
java.lang.Enum<DevelopMode>
org.sm.smtools.application.util.DevelopMode
All Implemented Interfaces:
Serializable, Comparable<DevelopMode>, Constable

public enum DevelopMode extends Enum<DevelopMode>
The DevelopMode class allows a global specification of an application's status.

This class can be used to check whether or not an application should use 'hacks' during its development. These hacks are created by the programmer. They provide convenient backdoors during the development phase (e.g., for skipping intros, about boxes, confirmation dialogs when quitting, ...). Their use is checked against a global flag, in the following manner:

   if (DevelopMode.kINSTANCE.isActivated()) {
     ... // perform 'hacks'
   }
 
Changing the status is done through direct assignment:
   DevelopMode.kINSTANCE.activate();
 

If activation is required before any class initialisation, then use a static initialiser as follows:

   static {
DevelopMode.kINSTANCE.activate();
}
Note that the default value is false.
Version:
26/06/2018
Author:
Sven Maerivoet
  • Enum Constant Details

    • kINSTANCE

      public static final DevelopMode kINSTANCE
      The singleton instance.
  • Method Details

    • values

      public static DevelopMode[] 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 DevelopMode 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
    • activate

      public void activate()
      Activates develop mode.
    • deactivate

      public void deactivate()
      Deactivates develop mode.
    • isActivated

      public boolean isActivated()
      Returns whether or not the develop mode is activated.
      Returns:
      true if the develop mode is activated, false otherwise