Package dev.gmitch215.bytebox.gradle
Enum Class Triggers
- All Implemented Interfaces:
Serializable,Comparable<Triggers>,Constable
Which triggers a handler class handles.
Read from the class itself rather than declared twice. A Worker implements one interface per trigger, so the interfaces it implements are already the answer, and asking the class means a configuration cannot drift from the code.
- Since:
- 1.0.0
-
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 TypeMethodDescriptionReturns the name the generated Worker exports for this trigger.Returns the interface a handler implements to handle this trigger.Reads the triggers a class handles.static TriggersReturns the enum constant of this class with the specified name.static Triggers[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FETCH
HTTP requests. -
SCHEDULED
Cron Triggers. -
EMAIL
Incoming email. -
QUEUE
Queue batches. -
TAIL
Trace events from another Worker. -
ALARM
A Durable Object alarm.
-
-
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
-
interfaceName
Returns the interface a handler implements to handle this trigger.- Returns:
- the interface a handler implements to handle this trigger
-
exportName
Returns the name the generated Worker exports for this trigger.- Returns:
- the name the generated Worker exports for this trigger
-
of
Reads the triggers a class handles.Loads the class without initialising it, so no user code runs. The alternative would be parsing the class file, which answers the same question with more that can go wrong.
- Parameters:
handlerClass- the fully qualified class nameclasspath- where to find it and the interfaces it implements- Returns:
- the triggers, in declaration order
-