public class CustomTaskState
extends java.lang.Object
Constructor and Description |
---|
CustomTaskState()
For serialization purposes only.
|
CustomTaskState(java.lang.String id,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
TaskState |
asPredefined()
Returns corresponding value of
TaskState that has the same name as ID of this state. |
boolean |
equals(java.lang.Object o) |
static CustomTaskState |
fromPredefined(TaskState state)
Creates custom state for which ID is identical to
Enum.name of the given predefined state and isPredefined()
returns true. |
java.lang.String |
getId()
Unique ID (e.g.
|
java.lang.String |
getPresentableName()
Text that describes this state and will be shown to user in UI (unlike ID it's not necessarily unique).
|
int |
hashCode() |
boolean |
isPredefined()
Means that this custom state can be directly mapped to legacy
TaskState . |
void |
setId(java.lang.String id)
For serialization purposes only.
|
void |
setPredefined(boolean predefined)
For serialization purposes only.
|
void |
setPresentableName(java.lang.String name)
For serialization purposes only.
|
java.lang.String |
toString() |
public CustomTaskState()
public CustomTaskState(java.lang.String id, java.lang.String name)
public java.lang.String getId()
TaskRepository.setTaskState(Task, CustomTaskState)
.public void setId(java.lang.String id)
public java.lang.String getPresentableName()
public void setPresentableName(java.lang.String name)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static CustomTaskState fromPredefined(TaskState state)
Enum.name
of the given predefined state and isPredefined()
returns true. If your repository provides only fixed set of available states, that are one of those described in TaskState
,
you may find this methods useful to implement TaskRepository.getAvailableTaskStates(Task)
.asPredefined()
,
isPredefined()
,
TaskRepository.getAvailableTaskStates(Task)
public TaskState asPredefined()
TaskState
that has the same name as ID of this state.
It's intended to be used for custom states created using fromPredefined(com.intellij.tasks.TaskState)
.null
if such state doesn't exists or isPredefined()
returns falseisPredefined()
public boolean isPredefined()
TaskState
. If it's false, asPredefined()
returns null
.
It's intended to be used mainly for compatibility with existing repositories.asPredefined()
public void setPredefined(boolean predefined)
public java.lang.String toString()
toString
in class java.lang.Object