Class StateBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<State>
Example to create an instance using the builder pattern
State state = State.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.key("{key}")
.type(StateTypeEnum.ORDER_STATE)
.initial(true)
.builtIn(true)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlist of States of the sametype
that the current State can be transitioned to.build()
builds State with checking for non-null required valuesbuilds State without checking for non-null required valuestrue
for States that are an integral part of the Project.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the State was initially created.Present on resources created after 1 February 2019 except for events not tracked.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) Present on resources created after 1 February 2019 except for events not tracked.description
(LocalizedString description) Description of the State.Description of the State.true
for States that are an integral part of the Project.Date and time (UTC) the State was initially created.Present on resources created after 1 February 2019 except for events not tracked.Description of the State.getId()
Unique identifier of the State.true
for an initial State, the first State in a workflow.getKey()
User-defined unique identifier of the State.Date and time (UTC) the State was last updated.Present on resources created after 1 February 2019 except for events not tracked.getName()
Name of the State.getRoles()
Roles the State can fulfill for Reviews and Line Items.list of States of the sametype
that the current State can be transitioned to.getType()
Indicates to which resource or object types the State is assigned to.Current version of the State.Unique identifier of the State.true
for an initial State, the first State in a workflow.User-defined unique identifier of the State.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the State was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) Present on resources created after 1 February 2019 except for events not tracked.Present on resources created after 1 February 2019 except for events not tracked.name
(LocalizedString name) Name of the State.Name of the State.static StateBuilder
of()
factory method for an instance of StateBuilderstatic StateBuilder
create builder for State instanceplusRoles
(StateRoleEnum... roles) Roles the State can fulfill for Reviews and Line Items.plusTransitions
(StateReference... transitions) list of States of the sametype
that the current State can be transitioned to.list of States of the sametype
that the current State can be transitioned to.roles
(StateRoleEnum... roles) Roles the State can fulfill for Reviews and Line Items.roles
(List<StateRoleEnum> roles) Roles the State can fulfill for Reviews and Line Items.list of States of the sametype
that the current State can be transitioned to.transitions
(StateReference... transitions) list of States of the sametype
that the current State can be transitioned to.transitions
(List<StateReference> transitions) list of States of the sametype
that the current State can be transitioned to.type
(StateTypeEnum type) Indicates to which resource or object types the State is assigned to.Current version of the State.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) Present on resources created after 1 February 2019 except for events not tracked.Description of the State.Present on resources created after 1 February 2019 except for events not tracked.Name of the State.list of States of the sametype
that the current State can be transitioned to.
-
Constructor Details
-
StateBuilder
public StateBuilder()
-
-
Method Details
-
id
Unique identifier of the State.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the State.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the State was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the State was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the State.
- Parameters:
key
- value to be set- Returns:
- Builder
-
type
Indicates to which resource or object types 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
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
true
for an initial State, the first State in a workflow.- Parameters:
initial
- value to be set- Returns:
- Builder
-
builtIn
true
for States that are an integral part of the Project. Those States cannot be deleted and theirkey
cannot be changed.- Parameters:
builtIn
- value to be set- Returns:
- Builder
-
roles
Roles the State can fulfill for Reviews and Line Items.
- Parameters:
roles
- value to be set- Returns:
- Builder
-
roles
Roles the State can fulfill for Reviews and Line Items.
- Parameters:
roles
- value to be set- Returns:
- Builder
-
plusRoles
Roles the State can fulfill for Reviews and Line Items.
- Parameters:
roles
- value to be set- Returns:
- Builder
-
transitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
transitions
- value to be set- Returns:
- Builder
- list of States of the same
-
transitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
transitions
- value to be set- Returns:
- Builder
- list of States of the same
-
plusTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
transitions
- value to be set- Returns:
- Builder
- list of States of the same
-
plusTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
builder
- function to build the transitions value- Returns:
- Builder
- list of States of the same
-
withTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
builder
- function to build the transitions value- Returns:
- Builder
- list of States of the same
-
addTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
builder
- function to build the transitions value- Returns:
- Builder
- list of States of the same
-
setTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Parameters:
builder
- function to build the transitions value- Returns:
- Builder
- list of States of the same
-
getId
Unique identifier of the State.
- Returns:
- id
-
getVersion
Current version of the State.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the State was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the State was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Returns:
- lastModifiedBy
-
getCreatedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the State.
- Returns:
- key
-
getType
Indicates to which resource or object types the State is assigned to.
- Returns:
- type
-
getName
Name of the State.
- Returns:
- name
-
getDescription
Description of the State.
- Returns:
- description
-
getInitial
true
for an initial State, the first State in a workflow.- Returns:
- initial
-
getBuiltIn
true
for States that are an integral part of the Project. Those States cannot be deleted and theirkey
cannot be changed.- Returns:
- builtIn
-
getRoles
Roles the State can fulfill for Reviews and Line Items.
- Returns:
- roles
-
getTransitions
- list of States of the same
type
that the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderState
and this list contains the reference to the ShippedOrderState
, the transition Initial -> Shipped is allowed. - if empty, no transitions are allowed from the current State, defining the current State as final for this workflow.
- if not set, the validation is turned off and the current State can be transitioned to any other State of the same
type
as the current State.
- Returns:
- transitions
- list of States of the same
-
build
builds State with checking for non-null required values- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<State>
- Returns:
- State
-
buildUnchecked
builds State without checking for non-null required values- Returns:
- State
-
of
factory method for an instance of StateBuilder- Returns:
- builder
-
of
create builder for State instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-