Package com.tnsai.planning.tasklist
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 namedescription- human-readable descriptionpriority- task prioritycriteria- optional completion criteria for refinement- tags for filtering and progress memory lookupmetadata- 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:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskItem.BuilderCreates a new builder.criteria()Returns the value of thecriteriarecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanChecks if this task has completion criteria.final inthashCode()Returns a hash code value for this object.booleanChecks if this task has the specified tag.id()Returns the value of theidrecord component.metadata()Returns the value of themetadatarecord component.name()Returns the value of thenamerecord component.static TaskItemCreates a simple task with name and description.com.tnsai.enums.agent.Prioritypriority()Returns the value of thepriorityrecord component.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates a simple task with name and description.- Parameters:
name- task namedescription- task description- Returns:
- new TaskItem
-
builder
Creates a new builder.- Parameters:
name- task name- Returns:
- new builder
-
hasCriteria
public boolean hasCriteria()Checks if this task has completion criteria. -
hasTag
Checks if this task has the specified tag. -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
priority
public com.tnsai.enums.agent.Priority priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
criteria
Returns the value of thecriteriarecord component.- Returns:
- the value of the
criteriarecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-