Interface TaskService<T extends Task,S>
- Type Parameters:
T
- The task type.S
- The type of the additional data used inModifyTaskDto
.
- All Known Implementing Classes:
BaseTaskInGroupService
,BaseTaskService
Interface for classes that manage
Task
s.-
Method Summary
Modifier and TypeMethodDescriptioncreate
(long id, @Valid ModifyTaskDto<S> dto) Creates a new task.void
delete
(long id) Deletes the task with the specified identifier.get
(long id) Returns the task with the specified identifier.update
(long id, @Valid ModifyTaskDto<S> dto) Updates an existing task.
-
Method Details
-
get
Returns the task with the specified identifier.- Parameters:
id
- The identifier.- Returns:
- The task or an empty result if the task does not exist.
-
create
Creates a new task.- Parameters:
id
- The task identifier.dto
- The task data.- Returns:
- The data that should be sent to the task administration UI (might be
null
). - Throws:
DuplicateKeyException
- If a task with the specified identifier already exists.
-
update
Updates an existing task.- Parameters:
id
- The task identifier.dto
- The new task data.- Returns:
- The data that should be sent to the task administration UI (might be
null
). - Throws:
jakarta.persistence.EntityNotFoundException
- If the task does not exist.
-
delete
void delete(long id) Deletes the task with the specified identifier.- Parameters:
id
- The identifier of the task to delete.
-