Class StateDraftBuilder
- All Implemented Interfaces:
Builder<StateDraft>
Example to create an instance using the builder pattern
StateDraft stateDraft = StateDraft.builder()
.key("{key}")
.type(StateTypeEnum.ORDER_STATE)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDefine the list of States of the sametype
to which the current State can be transitioned to.build()
builds StateDraft with checking for non-null required valuesbuilds StateDraft without checking for non-null required valuesdescription
(LocalizedString description) Description of the State.Description of the State.Description of the State.Set tofalse
if the State is not the first step in a workflow.getKey()
User-defined unique identifier for the State.getName()
Name of the State.getRoles()
If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.Define the list of States of the sametype
to which the current State can be transitioned to.getType()
Specify to which resource or object type the State is assigned to.Set tofalse
if the State is not the first step in a workflow.User-defined unique identifier for the State.name
(LocalizedString name) Name of the State.Name of the State.static StateDraftBuilder
of()
factory method for an instance of StateDraftBuilderstatic StateDraftBuilder
of
(StateDraft template) create builder for StateDraft instanceplusRoles
(StateRoleEnum... roles) If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.plusTransitions
(StateResourceIdentifier... transitions) Define the list of States of the sametype
to which the current State can be transitioned to.Define the list of States of the sametype
to which the current State can be transitioned to.roles
(StateRoleEnum... roles) If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.roles
(List<StateRoleEnum> roles) If suitable, assign predifined roles the State can fulfill in case the State'stype
isLineItemState
orReviewState
.Define the list of States of the sametype
to which the current State can be transitioned to.transitions
(StateResourceIdentifier... transitions) Define the list of States of the sametype
to which the current State can be transitioned to.transitions
(List<StateResourceIdentifier> transitions) Define the list of States of the sametype
to which the current State can be transitioned to.type
(StateTypeEnum type) Specify to which resource or object type the State is assigned to.Description of the State.Name of the State.Define the list of States of the sametype
to which the current State can be transitioned to.
-
Constructor Details
-
StateDraftBuilder
public StateDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the State.
- Parameters:
key
- value to be set- Returns:
- Builder
-
type
Specify to which resource or object type the State is assigned to.
- Parameters:
type
- value to be set- Returns:
- Builder
-
name
Name of the State.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the State.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the State.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
public StateDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the State.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
Description of the State.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the State.
- Parameters:
description
- value to be set- Returns:
- Builder
-
initial
Set to
false
if the State is not the first step in a workflow.- Parameters:
initial
- value to be set- Returns:
- Builder
-
roles
If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Parameters:
roles
- value to be set- Returns:
- Builder
-
roles
If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Parameters:
roles
- value to be set- Returns:
- Builder
-
plusRoles
If suitable, assign predifined roles the State can fulfill in case the State's
type
isLineItemState
orReviewState
.- Parameters:
roles
- value to be set- Returns:
- Builder
-
transitions
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
- value to be set- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
transitions
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
- value to be set- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
plusTransitions
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
- value to be set- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
plusTransitions
public StateDraftBuilder plusTransitions(Function<StateResourceIdentifierBuilder, StateResourceIdentifierBuilder> builder) 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:
builder
- function to build the transitions value- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
withTransitions
public StateDraftBuilder withTransitions(Function<StateResourceIdentifierBuilder, StateResourceIdentifierBuilder> builder) 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:
builder
- function to build the transitions value- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
addTransitions
public StateDraftBuilder addTransitions(Function<StateResourceIdentifierBuilder, StateResourceIdentifier> builder) 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:
builder
- function to build the transitions value- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
setTransitions
public StateDraftBuilder setTransitions(Function<StateResourceIdentifierBuilder, StateResourceIdentifier> builder) 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:
builder
- function to build the transitions value- Returns:
- Builder
- If, for example, the current State is the Initial State of StateType
-
getKey
User-defined unique identifier for the State.
- Returns:
- key
-
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
Set to
false
if the State is not the first step in a workflow.- Returns:
- initial
-
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
-
build
builds StateDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<StateDraft>
- Returns:
- StateDraft
-
buildUnchecked
builds StateDraft without checking for non-null required values- Returns:
- StateDraft
-
of
factory method for an instance of StateDraftBuilder- Returns:
- builder
-
of
create builder for StateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-