Package com.homannsoftware.tasks.task
Class Task
java.lang.Object
com.homannsoftware.tasks.task.Task
A persisted task with a title and an irreversible completion state.
The version field lets JPA reject stale updates; it is not part of the API.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Task
protected Task()Creates an uninitialized instance for the JPA persistence provider. -
Task
Creates an incomplete task and strips surrounding whitespace from its title.- Parameters:
title- nonblank title, at most 120 UTF-16 code units before stripping- Throws:
IllegalArgumentException- if the title is null, blank or too long
-
-
Method Details
-
complete
public void complete()Marks this task completed; repeated calls leave it completed. -
getId
Reads the identity assigned by persistence.- Returns:
- database-generated identity, or null before one is assigned
-
getTitle
Reads the task title.- Returns:
- normalized title after construction or persistence loading
-
isCompleted
public boolean isCompleted()Reads the task's completion state.- Returns:
- whether completion has been recorded for this task
-