Enum Class Stage

java.lang.Object
java.lang.Enum<Stage>
io.github.kaktushose.jdac.introspection.Stage
All Implemented Interfaces:
Serializable, Comparable<Stage>, Constable

public enum Stage extends Enum<Stage>

The stage or "level" inside the framework at which a properties value is set.

JDACommands has the following stages in this order:

  1. CONFIGURATION -> setting of builder properties, extension loading, construction of framework components
  2. INITIALIZED -> after starting the framework (basically after JDACBuilder.start() completed), e.g. all definitions are indexed etc.
  3. RUNTIME -> inside a runtime but outside of processing an GenericInteractionCreateEvent, e.g. when InteractionControllerInstantiator.instance(Class, Introspection) is called
  4. INTERACTION -> when processing an GenericInteractionCreateEvent, e.g. in Middleware.accept(InvocationContext) or inside a user defined interaction controller method

Generally, a stage includes all properties that were set in a former stage:

To know in which stage a Property is available take a look at Property.stage().

More technical, a Stage with a certain ordinal contains all stages with a lower ordinal value:

stageA ⊆ stageB if stageA.ordinal < stageB.ordinal

Many user implementable methods are annotated with IntrospectionAccess. To get a hint in which stage this method will be called by JDA-Commands you can take a look at IntrospectionAccess.value().

  • Enum Constant Details

    • CONFIGURATION

      public static final Stage CONFIGURATION
    • INITIALIZED

      public static final Stage INITIALIZED
    • RUNTIME

      public static final Stage RUNTIME
    • INTERACTION

      public static final Stage INTERACTION
  • Method Details

    • values

      public static Stage[] 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 Stage 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