Record Class WorkflowClasses

java.lang.Object
java.lang.Record
dev.gmitch215.bytebox.gradle.WorkflowClasses
Record Components:
className - the fully qualified Java class name
singleton - whether it is reached through a static INSTANCE, as a Kotlin object is
All Implemented Interfaces:
Serializable

public record WorkflowClasses(String className, boolean singleton) extends Record implements Serializable
A Workflow class written in Java.

Read the way DurableObjects reads a Durable Object: the class is loaded without being initialised, so no user code runs, and it has to implement the interface the generated export calls.

Since:
1.0.3
See Also:
  • Constructor Details

    • WorkflowClasses

      public WorkflowClasses(String className, boolean singleton)
      Creates an instance of a WorkflowClasses record class.
      Parameters:
      className - the value for the className record component
      singleton - the value for the singleton record component
  • Method Details

    • simpleName

      public String simpleName()
      Returns the class's simple name, which is what the JavaScript class is called.
      Returns:
      the class's simple name, which is what the JavaScript class is called
    • bindingName

      public String bindingName()
      Returns the binding name, which is WORKFLOW_ and the class name upper-snaked.

      Derived from the same name the plugin compares against the bindings a project declared, so a project that declares its own binding for the class is not given a second one.

      Returns:
      the binding name, which is WORKFLOW_ and the class name upper-snaked
    • workflowName

      public String workflowName()
      Returns the Workflow's name, the class name in kebab case, which Cloudflare keeps unique per account.
      Returns:
      the Workflow's name, the class name in kebab case, which Cloudflare keeps unique per account
    • exportPrefix

      public String exportPrefix()
      Returns the prefix the generated export carries.
      Returns:
      the prefix the generated export carries
    • of

      public static List<WorkflowClasses> of(List<String> classNames, Iterable<File> classpath)
      Reads each named class.
      Parameters:
      classNames - the fully qualified class names
      classpath - where to find them and the interface they implement
      Returns:
      one entry per class, in the order named
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • className

      public String className()
      Returns the value of the className record component.
      Returns:
      the value of the className record component
    • singleton

      public boolean singleton()
      Returns the value of the singleton record component.
      Returns:
      the value of the singleton record component