Interface State
- All Superinterfaces:
BaseResource
,DomainResource<State>
,Identifiable<State>
,Referencable<State>
,ResourceIdentifiable<State>
,StateMixin
,Versioned<State>
,WithKey
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic StateBuilder
builder()
builder factory method for Statestatic StateBuilder
create builder for State instancestatic State
factory method to create a deep copy of State@NotNull Boolean
true
for States that are an integral part of the Project.@NotNull ZonedDateTime
Date and time (UTC) the State was initially created.@Valid CreatedBy
IDs and references that created the State.@Valid LocalizedString
Description of the State.@NotNull String
getId()
Unique identifier of the State.@NotNull Boolean
true
for an initial State, the first State in a workflow.@NotNull String
getKey()
User-defined unique identifier of the State.@NotNull ZonedDateTime
Date and time (UTC) the State was last updated.@Valid LastModifiedBy
IDs and references that last modified the State.@Valid LocalizedString
getName()
Name of the State.getRoles()
Roles the State can fulfill for Reviews and Line Items.@Valid List<StateReference>
list of States of the sametype
that the current State can be transitioned to.@NotNull StateTypeEnum
getType()
Indicates to which resource or object types the State is assigned to.@NotNull Long
Current version of the State.static State
of()
factory methodstatic State
factory method to create a shallow copy Statestatic ReferenceTypeId
void
setBuiltIn
(Boolean builtIn) true
for States that are an integral part of the Project.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the State was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the State.void
setDescription
(LocalizedString description) Description of the State.void
Unique identifier of the State.void
setInitial
(Boolean initial) true
for an initial State, the first State in a workflow.void
User-defined unique identifier of the State.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the State was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the State.void
setName
(LocalizedString name) Name of the State.void
setRoles
(StateRoleEnum... roles) Roles the State can fulfill for Reviews and Line Items.void
setRoles
(List<StateRoleEnum> roles) Roles the State can fulfill for Reviews and Line Items.void
setTransitions
(StateReference... transitions) list of States of the sametype
that the current State can be transitioned to.void
setTransitions
(List<StateReference> transitions) list of States of the sametype
that the current State can be transitioned to.void
setType
(StateTypeEnum type) Indicates to which resource or object types the State is assigned to.void
setVersion
(Long version) Current version of the State.static com.fasterxml.jackson.core.type.TypeReference<State>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.DomainResource
get
Methods inherited from interface com.commercetools.api.models.state.StateMixin
toReference, toResourceIdentifier
-
Method Details
-
getId
Unique identifier of the State.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<State>
- Specified by:
getId
in interfaceIdentifiable<State>
- Specified by:
getId
in interfaceVersioned<State>
- Returns:
- id
-
getVersion
Current version of the State.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<State>
- Specified by:
getVersion
in interfaceVersioned<State>
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the State was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the State was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the State.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the State.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the State.
-
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
List<StateRoleEnum> 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
-
setId
Unique identifier of the State.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the State.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the State was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the State was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
IDs and references that last modified the State.
- Parameters:
lastModifiedBy
- value to be set
-
setCreatedBy
IDs and references that created the State.
- Parameters:
createdBy
- value to be set
-
setKey
User-defined unique identifier of the State.
- Parameters:
key
- value to be set
-
setType
Indicates to which resource or object types 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
true
for an initial State, the first State in a workflow.- Parameters:
initial
- value to be set
-
setBuiltIn
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
-
setRoles
Roles the State can fulfill for Reviews and Line Items.
- Parameters:
roles
- values to be set
-
setRoles
Roles the State can fulfill for Reviews and Line Items.
- Parameters:
roles
- values to be set
-
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:
transitions
- values to be set
- 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:
transitions
- values to be set
- list of States of the same
-
of
factory method- Returns:
- instance of State
-
of
factory method to create a shallow copy State- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of State- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for State- Returns:
- builder
-
builder
create builder for State instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withState
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
referenceTypeId
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-