Interface StateDraft
- All Superinterfaces:
Draft<StateDraft>
,WithKey
Example to create an instance using the builder pattern
StateDraft stateDraft = StateDraft.builder()
.key("{key}")
.type(StateTypeEnum.ORDER_STATE)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic StateDraftBuilder
builder()
builder factory method for StateDraftstatic StateDraftBuilder
builder
(StateDraft template) create builder for StateDraft instancestatic StateDraft
deepCopy
(StateDraft template) factory method to create a deep copy of StateDraft@Valid LocalizedString
Description of the State.Set tofalse
if the State is not the first step in a workflow.@NotNull String
getKey()
User-defined unique identifier for the State.@Valid LocalizedString
getName()
Name of the State.getRoles()
If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.@Valid List<StateResourceIdentifier>
Define the list of States of the sametype
to which the current State can be transitioned to.@NotNull StateTypeEnum
getType()
Specify to which resource or object type the State is assigned to.static StateDraft
of()
factory methodstatic StateDraft
of
(StateDraft template) factory method to create a shallow copy StateDraftvoid
setDescription
(LocalizedString description) Description of the State.void
setInitial
(Boolean initial) Set tofalse
if the State is not the first step in a workflow.void
User-defined unique identifier for the State.void
setName
(LocalizedString name) Name of the State.void
setRoles
(StateRoleEnum... roles) If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.void
setRoles
(List<StateRoleEnum> roles) If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.void
setTransitions
(StateResourceIdentifier... transitions) Define the list of States of the sametype
to which the current State can be transitioned to.void
setTransitions
(List<StateResourceIdentifier> transitions) Define the list of States of the sametype
to which the current State can be transitioned to.void
setType
(StateTypeEnum type) Specify to which resource or object type the State is assigned to.static com.fasterxml.jackson.core.type.TypeReference<StateDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withStateDraft
(Function<StateDraft, T> helper) accessor map function
-
Method Details
-
getKey
User-defined unique identifier for the State.
-
getType
Specify to which resource or object type the State is assigned to.
- Returns:
- type
-
getName
Name of the State.
- Returns:
- name
-
getDescription
Description of the State.
- Returns:
- description
-
getInitial
Boolean getInitial()Set to
false
if the State is not the first step in a workflow.- Returns:
- initial
-
getRoles
List<StateRoleEnum> getRoles()If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Returns:
- roles
-
getTransitions
Define the list of States of the same
type
to which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderState
and you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderState
to this list. - Set to empty list for not allowing any transition from the current State and defining it as final State for a workflow.
- Do not set this field at all to turn off validation and allowing transitions to any other State of the same
type
as the current State.
- Returns:
- transitions
- If, for example, the current State is the Initial State of StateType
-
setKey
User-defined unique identifier for the State.
- Parameters:
key
- value to be set
-
setType
Specify to which resource or object type the State is assigned to.
- Parameters:
type
- value to be set
-
setName
Name of the State.
- Parameters:
name
- value to be set
-
setDescription
Description of the State.
- Parameters:
description
- value to be set
-
setInitial
Set to
false
if the State is not the first step in a workflow.- Parameters:
initial
- value to be set
-
setRoles
If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Parameters:
roles
- values to be set
-
setRoles
If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Parameters:
roles
- values to be set
-
setTransitions
Define the list of States of the same
type
to which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderState
and you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderState
to this list. - Set to empty list for not allowing any transition from the current State and defining it as final State for a workflow.
- Do not set this field at all to turn off validation and allowing transitions to any other State of the same
type
as the current State.
- Parameters:
transitions
- values to be set
- If, for example, the current State is the Initial State of StateType
-
setTransitions
Define the list of States of the same
type
to which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderState
and you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderState
to this list. - Set to empty list for not allowing any transition from the current State and defining it as final State for a workflow.
- Do not set this field at all to turn off validation and allowing transitions to any other State of the same
type
as the current State.
- Parameters:
transitions
- values to be set
- If, for example, the current State is the Initial State of StateType
-
of
factory method- Returns:
- instance of StateDraft
-
of
factory method to create a shallow copy StateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of StateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StateDraft- Returns:
- builder
-
builder
create builder for StateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStateDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-