Record Class TaskItem

java.lang.Object
java.lang.Record
com.tnsai.planning.tasklist.TaskItem
Record Components:
id - unique identifier (auto-generated if null)
name - task name
description - human-readable description
priority - task priority
criteria - optional completion criteria for refinement
tags - tags for filtering and progress memory lookup
metadata - arbitrary key-value metadata

public record TaskItem(String id, String name, String description, com.tnsai.enums.agent.Priority priority, CompletionCriteria criteria, Set<String> tags, Map<String,Object> metadata) extends Record
A single task in a task list.

Tasks are the atomic units of work in the Ralph Pattern. Each task has a name, description, optional completion criteria, and metadata for tracking.

Usage


 TaskItem task = TaskItem.builder("Implement auth")
     .description("Create JWT authentication module")
     .priority(Priority.HIGH)
     .criteria(CompletionCriteria.builder()
         .mustContain("@RestController")
         .testCommand("mvn test -pl auth")
         .build())
     .tags("auth", "backend")
     .build();
 
Author:
TnsAI Team
See Also:
  • Constructor Details

  • Method Details

    • of

      public static TaskItem of(String name, String description)
      Creates a simple task with name and description.
      Parameters:
      name - task name
      description - task description
      Returns:
      new TaskItem
    • builder

      public static TaskItem.Builder builder(String name)
      Creates a new builder.
      Parameters:
      name - task name
      Returns:
      new builder
    • hasCriteria

      public boolean hasCriteria()
      Checks if this task has completion criteria.
    • hasTag

      public boolean hasTag(String tag)
      Checks if this task has the specified tag.
    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • priority

      public com.tnsai.enums.agent.Priority priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • criteria

      public CompletionCriteria criteria()
      Returns the value of the criteria record component.
      Returns:
      the value of the criteria record component
    • tags

      public Set<String> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • metadata

      public Map<String,Object> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component