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 StateDraftBuilderbuilder()builder factory method for StateDraftstatic StateDraftBuilderbuilder(StateDraft template) create builder for StateDraft instancecopyDeep()static StateDraftdeepCopy(StateDraft template) factory method to create a deep copy of StateDraft@Valid LocalizedStringDescription of the State.Set tofalseif the State is not the first step in a workflow.@NotNull StringgetKey()User-defined unique identifier for the State.@Valid LocalizedStringgetName()Name of the State.getRoles()If suitable, assign predefined roles the State can fulfill in case the State'stypeisLineItemStateorReviewState.@Valid List<StateResourceIdentifier>Define the list of States of the sametypeto which the current State can be transitioned to.@NotNull StateTypeEnumgetType()Specify to which resource or object type the State is assigned to.static StateDraftof()factory methodstatic StateDraftof(StateDraft template) factory method to create a shallow copy StateDraftvoidsetDescription(LocalizedString description) Description of the State.voidsetInitial(Boolean initial) Set tofalseif the State is not the first step in a workflow.voidUser-defined unique identifier for the State.voidsetName(LocalizedString name) Name of the State.voidsetRoles(StateRoleEnum... roles) If suitable, assign predefined roles the State can fulfill in case the State'stypeisLineItemStateorReviewState.voidsetRoles(List<StateRoleEnum> roles) If suitable, assign predefined roles the State can fulfill in case the State'stypeisLineItemStateorReviewState.voidsetTransitions(StateResourceIdentifier... transitions) Define the list of States of the sametypeto which the current State can be transitioned to.voidsetTransitions(List<StateResourceIdentifier> transitions) Define the list of States of the sametypeto which the current State can be transitioned to.voidsetType(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> TwithStateDraft(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
falseif the State is not the first step in a workflow.- Returns:
- initial
-
getRoles
List<StateRoleEnum> getRoles()If suitable, assign predefined roles the State can fulfill in case the State's
typeisLineItemStateorReviewState.- Returns:
- roles
-
getTransitions
Define the list of States of the same
typeto which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderStateand you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderStateto 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
typeas 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
falseif the State is not the first step in a workflow.- Parameters:
initial- value to be set
-
setRoles
If suitable, assign predefined roles the State can fulfill in case the State's
typeisLineItemStateorReviewState.- Parameters:
roles- values to be set
-
setRoles
If suitable, assign predefined roles the State can fulfill in case the State's
typeisLineItemStateorReviewState.- Parameters:
roles- values to be set
-
setTransitions
Define the list of States of the same
typeto which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderStateand you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderStateto 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
typeas 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
typeto which the current State can be transitioned to.- If, for example, the current State is the Initial State of StateType
OrderStateand you want to allow the transition Initial -> Shipped, then add the StateResourceIdentifier to the ShippedOrderStateto 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
typeas 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
-
copyDeep
StateDraft copyDeep() -
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
-