Class StateDraftImpl

java.lang.Object
com.commercetools.api.models.state.StateDraftImpl
All Implemented Interfaces:
StateDraft, WithKey, io.vrap.rmf.base.client.Draft<StateDraft>, io.vrap.rmf.base.client.ModelBase

public class StateDraftImpl extends Object implements StateDraft, io.vrap.rmf.base.client.ModelBase
StateDraft
  • Constructor Details

    • StateDraftImpl

      public StateDraftImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

      User-defined unique identifier for the State.

      Specified by:
      getKey in interface StateDraft
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getType

      public StateTypeEnum getType()

      Specify to which resource or object type the State is assigned to.

      Specified by:
      getType in interface StateDraft
      Returns:
      type
    • getName

      public LocalizedString getName()

      Name of the State.

      Specified by:
      getName in interface StateDraft
      Returns:
      name
    • getDescription

      public LocalizedString getDescription()

      Description of the State.

      Specified by:
      getDescription in interface StateDraft
      Returns:
      description
    • getInitial

      public Boolean getInitial()

      Set to false if the State is not the first step in a workflow.

      Specified by:
      getInitial in interface StateDraft
      Returns:
      initial
    • getRoles

      public List<StateRoleEnum> getRoles()

      If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

      Specified by:
      getRoles in interface StateDraft
      Returns:
      roles
    • getTransitions

      public List<StateResourceIdentifier> 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 Shipped OrderState 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.
      Specified by:
      getTransitions in interface StateDraft
      Returns:
      transitions
    • setKey

      public void setKey(String key)
      Description copied from interface: StateDraft

      User-defined unique identifier for the State.

      Specified by:
      setKey in interface StateDraft
      Parameters:
      key - value to be set
    • setType

      public void setType(StateTypeEnum type)
      Description copied from interface: StateDraft

      Specify to which resource or object type the State is assigned to.

      Specified by:
      setType in interface StateDraft
      Parameters:
      type - value to be set
    • setName

      public void setName(LocalizedString name)
      Description copied from interface: StateDraft

      Name of the State.

      Specified by:
      setName in interface StateDraft
      Parameters:
      name - value to be set
    • setDescription

      public void setDescription(LocalizedString description)
      Description copied from interface: StateDraft

      Description of the State.

      Specified by:
      setDescription in interface StateDraft
      Parameters:
      description - value to be set
    • setInitial

      public void setInitial(Boolean initial)
      Description copied from interface: StateDraft

      Set to false if the State is not the first step in a workflow.

      Specified by:
      setInitial in interface StateDraft
      Parameters:
      initial - value to be set
    • setRoles

      public void setRoles(StateRoleEnum... roles)
      Description copied from interface: StateDraft

      If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

      Specified by:
      setRoles in interface StateDraft
      Parameters:
      roles - values to be set
    • setRoles

      public void setRoles(List<StateRoleEnum> roles)
      Description copied from interface: StateDraft

      If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

      Specified by:
      setRoles in interface StateDraft
      Parameters:
      roles - values to be set
    • setTransitions

      public void setTransitions(StateResourceIdentifier... transitions)
      Description copied from interface: StateDraft

      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 Shipped OrderState 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.
      Specified by:
      setTransitions in interface StateDraft
      Parameters:
      transitions - values to be set
    • setTransitions

      public void setTransitions(List<StateResourceIdentifier> transitions)
      Description copied from interface: StateDraft

      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 Shipped OrderState 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.
      Specified by:
      setTransitions in interface StateDraft
      Parameters:
      transitions - values to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object