Record Class FeatureStepState

java.lang.Object
java.lang.Record
app.ductape.sdk.features.executor.state.FeatureStepState

public record FeatureStepState(String tag, StepKind kind, StepStatus status, long startedAt, long completedAt, Object output, String error, int attempts) extends Record
Sprint 4 — TS-shaped runtime state for a single feature step.
  • Constructor Details

    • FeatureStepState

      public FeatureStepState(String tag, StepKind kind, StepStatus status, long startedAt, long completedAt, Object output, String error, int attempts)
      Creates an instance of a FeatureStepState record class.
      Parameters:
      tag - the value for the tag record component
      kind - the value for the kind record component
      status - the value for the status record component
      startedAt - the value for the startedAt record component
      completedAt - the value for the completedAt record component
      output - the value for the output record component
      error - the value for the error record component
      attempts - the value for the attempts record component
  • Method Details

    • pending

      public static FeatureStepState pending(String tag, StepKind kind)
    • running

      public FeatureStepState running(long now, int attempt)
    • completed

      public FeatureStepState completed(long now, Object result)
    • failed

      public FeatureStepState failed(long now, String message)
    • toMap

      public Map<String,Object> toMap()
    • 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.
    • tag

      public String tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component
    • kind

      public StepKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • status

      public StepStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • startedAt

      public long startedAt()
      Returns the value of the startedAt record component.
      Returns:
      the value of the startedAt record component
    • completedAt

      public long completedAt()
      Returns the value of the completedAt record component.
      Returns:
      the value of the completedAt record component
    • output

      public Object output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • error

      public String error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component
    • attempts

      public int attempts()
      Returns the value of the attempts record component.
      Returns:
      the value of the attempts record component