Package de.xima.fc.workflow.taglib.model
Class FlowchartSelection<TElement>
- java.lang.Object
-
- de.xima.fc.workflow.taglib.model.FlowchartSelection<TElement>
-
- Type Parameters:
TElement
- Type of the selected element.
- All Implemented Interfaces:
IElementWithTask<TElement>
,ITaskUuidProviding
,Serializable
public final class FlowchartSelection<TElement> extends Object implements IElementWithTask<TElement>, Serializable
Describes the currently selected element of the flowchart. The current selection can be either a trigger, a node, or nothing.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
TElement
getElement()
<T> T
getElementAs(Class<T> type)
ElementKey
getElementKey()
NodeModel
getNode()
NodeKey
getNodeKey()
UUID
getTaskUuid()
TriggerModel
getTrigger()
TriggerKey
getTriggerKey()
EFlowchartSelectionType
getType()
UUID
getUuid()
int
hashCode()
boolean
isEmpty()
boolean
isHasSelection()
boolean
isNode()
boolean
isTrigger()
static FlowchartSelection<Void>
ofEmpty()
static FlowchartSelection<NodeModel>
ofNode(UUID taskUuid, NodeModel nodeModel)
static FlowchartSelection<TriggerModel>
ofTrigger(UUID taskUuid, TriggerModel triggerModel)
String
toString()
-
-
-
Method Detail
-
getElement
@Nullable public TElement getElement()
- Specified by:
getElement
in interfaceIElementWithTask<TElement>
- Returns:
- The instance of the wrapped workflow element.
-
getElementAs
public <T> T getElementAs(Class<T> type)
- Type Parameters:
T
- Type to return.- Parameters:
type
- Type to return.- Returns:
- The current selection cast to the given type, or
null
if there is no selection ir the select is not of the given type.
-
getElementKey
@Nullable public ElementKey getElementKey()
- Returns:
- If a node is selected, the element key for the selected node. If a trigger is selected, the element key for
the selected trigger. Otherwise,
null
.
-
getNode
public NodeModel getNode()
- Returns:
- When a
isNode()
is selected, returns that node, ornull
otherwise.
-
getNodeKey
@Nullable public NodeKey getNodeKey()
- Returns:
- The node key if a node is selected, or
null
otherwise.
-
getTaskUuid
@Nullable public UUID getTaskUuid()
- Specified by:
getTaskUuid
in interfaceIElementWithTask<TElement>
- Specified by:
getTaskUuid
in interfaceITaskUuidProviding
- Returns:
- The UUID that identifies the task to which the workflow element belongs.
-
getTrigger
public TriggerModel getTrigger()
- Returns:
- When a
isTrigger()
is selected, returns that trigger, ornull
otherwise.
-
getTriggerKey
@Nullable public TriggerKey getTriggerKey()
- Returns:
- The node key if a trigger is selected, or
null
otherwise.
-
getType
public EFlowchartSelectionType getType()
-
getUuid
@Nullable public UUID getUuid()
-
isEmpty
public boolean isEmpty()
-
isHasSelection
public boolean isHasSelection()
-
isNode
public boolean isNode()
-
isTrigger
public boolean isTrigger()
-
ofEmpty
public static FlowchartSelection<Void> ofEmpty()
-
ofNode
public static FlowchartSelection<NodeModel> ofNode(UUID taskUuid, NodeModel nodeModel)
-
ofTrigger
public static FlowchartSelection<TriggerModel> ofTrigger(UUID taskUuid, TriggerModel triggerModel)
-
-