Package madkit.kernel

Enum Class Madkit.BooleanOption

java.lang.Object
java.lang.Enum<Madkit.BooleanOption>
madkit.kernel.Madkit.BooleanOption
All Implemented Interfaces:
Serializable, Comparable<Madkit.BooleanOption>, java.lang.constant.Constable, MadkitOption
Enclosing class:
Madkit

public static enum Madkit.BooleanOption extends Enum<Madkit.BooleanOption> implements MadkitOption
Option used to activate or disable features on startup. These options can be used from the command line or using the main method of MaDKit.
 SYNOPSIS
 
--optionName [true|false]
 DESCRIPTION
 
If no boolean value is specified, the option is considered as being set to true.
 EXAMPLES
 
  • --optionName false
  • --optionName (equivalent to)
  • --optionName true
Since:
MaDKit 5
Version:
0.9
Author:
Fabien Michel
  • Enum Constant Details

  • Method Details

    • values

      public static Madkit.BooleanOption[] 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 Madkit.BooleanOption 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
    • isActivated

      public boolean isActivated(Properties session)
      Tells if this option is activated for this session.
      Parameters:
      session -
      Returns:
      true if this boolean option is set to true for this config
    • toString

      public String toString()
      Returns the constant's name prefixed by "--" so that it could interpreted as an option of the command line or in Madkit(String...).
      Specified by:
      toString in interface MadkitOption
      Overrides:
      toString in class Enum<Madkit.BooleanOption>
      Returns:
      The command line form for this option, with -- in front of the option's name, i.e. --optionName