Class TaskEvent
- java.lang.Object
-
- com.inet.taskplanner.server.api.event.TaskEvent
-
public class TaskEvent extends java.lang.Object
Event when a task was added, modified, deleted, activated, deactivated, started or execution finished.- Since:
- taskplanner 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TaskEvent.TaskEventType
Possible task events
-
Constructor Summary
Constructors Constructor Description TaskEvent(int progress, com.inet.id.GUID taskID)
Creates a new TaskEvent instance with a fixed type ofTaskEvent.TaskEventType.PROGRESS
TaskEvent(TaskEvent.TaskEventType type, com.inet.id.GUID taskID)
Creates a new TaskEvent instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getProgress()
Returns the progress of the current task execution in casegetType()
returnsTaskEvent.TaskEventType.PROGRESS
com.inet.id.GUID
getTaskID()
Get the ID of the task this event is about.TaskEvent.TaskEventType
getType()
Get the type of this event.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
TaskEvent
public TaskEvent(@Nonnull TaskEvent.TaskEventType type, @Nonnull com.inet.id.GUID taskID)
Creates a new TaskEvent instance.- Parameters:
type
- the type for this eventtaskID
- the task the event is for- Throws:
java.lang.IllegalArgumentException
- if type or taskID is null.- Since:
- taskplanner 3.0
-
TaskEvent
public TaskEvent(int progress, @Nonnull com.inet.id.GUID taskID)
Creates a new TaskEvent instance with a fixed type ofTaskEvent.TaskEventType.PROGRESS
- Parameters:
progress
- the progress of the current execution of the task, a value in range of [0..100]taskID
- the task the event is for- Throws:
java.lang.IllegalArgumentException
- if type or taskID is null.- Since:
- taskplanner 3.0
-
-
Method Detail
-
getType
@Nonnull public TaskEvent.TaskEventType getType()
Get the type of this event.- Returns:
- the type of this event
- Since:
- taskplanner 3.0
-
getTaskID
@Nonnull public com.inet.id.GUID getTaskID()
Get the ID of the task this event is about.- Returns:
- ID of the corresponding task.
- Since:
- taskplanner 3.0
-
getProgress
public int getProgress()
Returns the progress of the current task execution in casegetType()
returnsTaskEvent.TaskEventType.PROGRESS
- Returns:
- the progress of the current task execution, a percentage value in range [0..100]
- Since:
- taskplanner 3.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-