Record Class WorkflowInitContext

java.lang.Object
java.lang.Record
com.yworkflow.definition.model.init.WorkflowInitContext
Record Components:
properties - configuration properties
extensionProvider - extension provider
clock - time provider

public record WorkflowInitContext(Properties properties, ExtensionProvider extensionProvider, WorkflowClock clock) extends Record
Holder of configuration and components that are passed during Workflow Initialization.
  • Constructor Details

    • WorkflowInitContext

      public WorkflowInitContext(Properties properties, ExtensionProvider extensionProvider, WorkflowClock clock)
      Creates an instance of a WorkflowInitContext record class.
      Parameters:
      properties - the value for the properties record component
      extensionProvider - the value for the extensionProvider record component
      clock - the value for the clock record component
  • Method Details

    • withProperties

      public WorkflowInitContext withProperties(Properties properties)
      Create a WorkflowInitContext updated with the configuration properties.
      Parameters:
      properties - configuration properties to update the context with
      Returns:
      updated context
    • withExtensionProvider

      public WorkflowInitContext withExtensionProvider(ExtensionProvider extensionProvider)
      Create a WorkflowInitContext updated with the ExtensionProvider.
      Parameters:
      extensionProvider - ExtensionProvider to update the context with
      Returns:
      updated context
    • withClock

      public WorkflowInitContext withClock(WorkflowClock clock)
      Create a WorkflowInitContext updated with the clock.
      Parameters:
      clock - clock to update the context with
      Returns:
      updated context
    • initContext

      public static WorkflowInitContext initContext()
      Create a default (empty) WorkflowInitContext.
      Returns:
      the context
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • properties

      public Properties properties()
      Returns the value of the properties record component.
      Returns:
      the value of the properties record component
    • extensionProvider

      public ExtensionProvider extensionProvider()
      Returns the value of the extensionProvider record component.
      Returns:
      the value of the extensionProvider record component
    • clock

      public WorkflowClock clock()
      Returns the value of the clock record component.
      Returns:
      the value of the clock record component