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 SummaryModifier and TypeMethodDescriptionstatic StateBuilderbuilder()builder factory method for Statestatic StateBuildercreate builder for State instancecopyDeep()static Statefactory method to create a deep copy of State@NotNull Booleantruefor States that are an integral part of the Project.@NotNull ZonedDateTimeDate and time (UTC) the State was initially created.@Valid CreatedByIDs and references that created the State.@Valid LocalizedStringDescription of the State.@NotNull StringgetId()Unique identifier of the State.@NotNull Booleantruefor an initial State, the first State in a workflow.@NotNull StringgetKey()User-defined unique identifier of the State.@NotNull ZonedDateTimeDate and time (UTC) the State was last updated.@Valid LastModifiedByIDs and references that last modified the State.@Valid LocalizedStringgetName()Name of the State.getRoles()Roles the State can fulfill for Reviews and Line Items.@Valid List<StateReference>list of States of the sametypethat the current State can be transitioned to.@NotNull StateTypeEnumgetType()Indicates to which resource or object types the State is assigned to.@NotNull LongCurrent version of the State.static Stateof()factory methodstatic Statefactory method to create a shallow copy Statestatic ReferenceTypeIdvoidsetBuiltIn(Boolean builtIn) truefor States that are an integral part of the Project.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the State was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the State.voidsetDescription(LocalizedString description) Description of the State.voidUnique identifier of the State.voidsetInitial(Boolean initial) truefor an initial State, the first State in a workflow.voidUser-defined unique identifier of the State.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the State was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the State.voidsetName(LocalizedString name) Name of the State.voidsetRoles(StateRoleEnum... roles) Roles the State can fulfill for Reviews and Line Items.voidsetRoles(List<StateRoleEnum> roles) Roles the State can fulfill for Reviews and Line Items.voidsetTransitions(StateReference... transitions) list of States of the sametypethat the current State can be transitioned to.voidsetTransitions(List<StateReference> transitions) list of States of the sametypethat the current State can be transitioned to.voidsetType(StateTypeEnum type) Indicates to which resource or object types the State is assigned to.voidsetVersion(Long version) Current version of the State.static com.fasterxml.jackson.core.type.TypeReference<State>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResourcewithBaseResourceMethods inherited from interface com.commercetools.api.models.DomainResourcegetMethods inherited from interface com.commercetools.api.models.state.StateMixintoReference, toResourceIdentifier
- 
Method Details- 
getIdUnique identifier of the State. - Specified by:
- getIdin interface- BaseResource
- Specified by:
- getIdin interface- DomainResource<State>
- Specified by:
- getIdin interface- Identifiable<State>
- Specified by:
- getIdin interface- Versioned<State>
- Returns:
- id
 
- 
getVersionCurrent version of the State. - Specified by:
- getVersionin interface- BaseResource
- Specified by:
- getVersionin interface- DomainResource<State>
- Specified by:
- getVersionin interface- Versioned<State>
- Returns:
- version
 
- 
getCreatedAtDate and time (UTC) the State was initially created. - Specified by:
- getCreatedAtin interface- BaseResource
- Returns:
- createdAt
 
- 
getLastModifiedAtDate and time (UTC) the State was last updated. - Specified by:
- getLastModifiedAtin interface- BaseResource
- Returns:
- lastModifiedAt
 
- 
getLastModifiedByIDs and references that last modified the State. - Returns:
- lastModifiedBy
 
- 
getCreatedByIDs and references that created the State. - Returns:
- createdBy
 
- 
getKeyUser-defined unique identifier of the State. 
- 
getTypeIndicates to which resource or object types the State is assigned to. - Returns:
- type
 
- 
getNameName of the State. - Returns:
- name
 
- 
getDescriptionDescription of the State. - Returns:
- description
 
- 
getInitialtruefor an initial State, the first State in a workflow.- Returns:
- initial
 
- 
getBuiltIntruefor States that are an integral part of the Project. Those States cannot be deleted and theirkeycannot be changed.- Returns:
- builtIn
 
- 
getRolesList<StateRoleEnum> getRoles()Roles the State can fulfill for Reviews and Line Items. - Returns:
- roles
 
- 
getTransitions- list of States of the same typethat the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderStateand 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 typeas the current State.
 - Returns:
- transitions
 
- list of States of the same 
- 
setIdUnique identifier of the State. - Specified by:
- setIdin interface- BaseResource
- Parameters:
- id- value to be set
 
- 
setVersionCurrent version of the State. - Specified by:
- setVersionin interface- BaseResource
- Parameters:
- version- value to be set
 
- 
setCreatedAtDate and time (UTC) the State was initially created. - Specified by:
- setCreatedAtin interface- BaseResource
- Parameters:
- createdAt- value to be set
 
- 
setLastModifiedAtDate and time (UTC) the State was last updated. - Specified by:
- setLastModifiedAtin interface- BaseResource
- Parameters:
- lastModifiedAt- value to be set
 
- 
setLastModifiedByIDs and references that last modified the State. - Parameters:
- lastModifiedBy- value to be set
 
- 
setCreatedByIDs and references that created the State. - Parameters:
- createdBy- value to be set
 
- 
setKeyUser-defined unique identifier of the State. - Parameters:
- key- value to be set
 
- 
setTypeIndicates to which resource or object types the State is assigned to. - Parameters:
- type- value to be set
 
- 
setNameName of the State. - Parameters:
- name- value to be set
 
- 
setDescriptionDescription of the State. - Parameters:
- description- value to be set
 
- 
setInitialtruefor an initial State, the first State in a workflow.- Parameters:
- initial- value to be set
 
- 
setBuiltIntruefor States that are an integral part of the Project. Those States cannot be deleted and theirkeycannot be changed.- Parameters:
- builtIn- value to be set
 
- 
setRolesRoles the State can fulfill for Reviews and Line Items. - Parameters:
- roles- values to be set
 
- 
setRolesRoles the State can fulfill for Reviews and Line Items. - Parameters:
- roles- values to be set
 
- 
setTransitions- list of States of the same typethat the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderStateand 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 typeas the current State.
 - Parameters:
- transitions- values to be set
 
- list of States of the same 
- 
setTransitions- list of States of the same typethat the current State can be transitioned to. For example, when the current State is the Initial State of StateTypeOrderStateand 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 typeas the current State.
 - Parameters:
- transitions- values to be set
 
- list of States of the same 
- 
offactory method- Returns:
- instance of State
 
- 
offactory method to create a shallow copy State- Parameters:
- template- instance to be copied
- Returns:
- copy instance
 
- 
copyDeepState copyDeep()- Specified by:
- copyDeepin interface- BaseResource
 
- 
deepCopyfactory method to create a deep copy of State- Parameters:
- template- instance to be copied
- Returns:
- copy instance
 
- 
builderbuilder factory method for State- Returns:
- builder
 
- 
buildercreate builder for State instance- Parameters:
- template- instance with prefilled values for the builder
- Returns:
- builder
 
- 
withStateaccessor map function- Type Parameters:
- T- mapped type
- Parameters:
- helper- function to map the object
- Returns:
- mapped value
 
- 
referenceTypeId
- 
typeReferencegives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
 
 
-