Class ActionDefinition.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.action.ActionDefinition.Builder
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelBuilder, ActionDefinitionContract
Enclosing class:
ActionDefinition

public static class ActionDefinition.Builder extends Object implements ActionDefinitionContract, ModelBuilder, Serializable
This builder is used to construct instances of KRMS Repository Action. It enforces the constraints of the ActionDefinitionContract.
See Also:
  • Method Details

    • create

      public static ActionDefinition.Builder create(String actionId, String name, String namespace, String typeId, String ruleId, Integer sequenceNumber)
      Create a builder with the given parameters
      Parameters:
      actionId - the actionId value to set, must no tbe null or blank
      name - the name value to set, must not be null or blank
      namespace - the namespace value to set, must not be null or blank
      typeId - the typeId value to set
      ruleId - the ruleId value to set, must not be null or blank
      sequenceNumber - the sequenceNumber value to set, must not be null or blank
      Returns:
      an instance of the builder populated with given data
    • create

      public static ActionDefinition.Builder create(ActionDefinitionContract contract)
      Creates a builder by populating it with data from the given ActionDefinitionContract.
      Parameters:
      contract - the contract from which to populate this builder
      Returns:
      an instance of the builder populated with data from the contract
      Throws:
      IllegalArgumentException - if the contract is null
    • setId

      public void setId(String actionId)
      Sets the value of the id on this builder to the given value.
      Parameters:
      actionId - the actionId value to set, must no tbe null or blank
      Throws:
      IllegalArgumentException - if the actionId is non-null and blank
    • setName

      public void setName(String name)
      Sets the value of the name on this builder to the given value.
      Parameters:
      name - the name value to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the name is non-null and blank
    • setNamespace

      public void setNamespace(String namespace)
      Sets the value of the namespace on this builder to the given value.
      Parameters:
      namespace - the namespace value to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the namespace is non-null and blank
    • setDescription

      public void setDescription(String desc)
      Sets the value of the description on this builder to the given value.
      Parameters:
      desc - the description value to set
    • setTypeId

      public void setTypeId(String typeId)
      Sets the value of the typeId on this builder to the given value.
      Parameters:
      typeId - the typeId value to set, must not be null or blank.
      Throws:
      IllegalArgumentException - if the typeId is null or blank
    • setRuleId

      public void setRuleId(String ruleId)
      Sets the value of the ruleId on this builder to the given value.
      Parameters:
      ruleId - the ruleId value to set, may be null but must not blank
      Throws:
      IllegalArgumentException - if the ruleId is blank
    • setSequenceNumber

      public void setSequenceNumber(Integer sequenceNumber)
      Sets the value of the sequenceNumber on this builder to the given value.
      Parameters:
      sequenceNumber - the sequenceNumber value to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the sequenceNumber is null or blank
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      Sets the value of the attributes on this builder to the given value.
      Parameters:
      attributes - the attributes value to set, can be null
    • setVersionNumber

      public void setVersionNumber(Long versionNumber)
      Sets the value of the versionNumber on this builder to the given value.
      Parameters:
      versionNumber - the versionNumber value to set
    • getId

      public String getId()
      Specified by:
      getId in interface Identifiable
    • getName

      public String getName()
      Description copied from interface: ActionDefinitionContract
      Returns the name of the Action

      name - the name of the Action

      Specified by:
      getName in interface ActionDefinitionContract
      Returns:
      the name of the Action
    • getNamespace

      public String getNamespace()
      Description copied from interface: ActionDefinitionContract
      Returns the namespace of the Action

      The namespace of the Action

      Specified by:
      getNamespace in interface ActionDefinitionContract
      Returns:
      the namespace of the Action
    • getDescription

      public String getDescription()
      Description copied from interface: ActionDefinitionContract
      Returns the description for what the parameter is used for. This can be null or a blank string.
      Specified by:
      getDescription in interface ActionDefinitionContract
      Returns:
      the description of the Action
    • getTypeId

      public String getTypeId()
      Description copied from interface: ActionDefinitionContract
      Returns the KrmsType of the Action
      Specified by:
      getTypeId in interface ActionDefinitionContract
      Returns:
      id for KRMS type related of the Action
    • getRuleId

      public String getRuleId()
      Description copied from interface: ActionDefinitionContract
      Returns the id of the rule associated with the action
      Specified by:
      getRuleId in interface ActionDefinitionContract
      Returns:
      id for the Rule associated with the action.
    • getSequenceNumber

      public Integer getSequenceNumber()
      Description copied from interface: ActionDefinitionContract
      Returns the sequence number of the action
      Specified by:
      getSequenceNumber in interface ActionDefinitionContract
      Returns:
      sequence number of the action.
    • getAttributes

      public Map<String,String> getAttributes()
      Description copied from interface: ActionDefinitionContract
      Returns a set of attributes associated with the Action. The attributes are represented as name/value pairs.
      Specified by:
      getAttributes in interface ActionDefinitionContract
      Returns:
      a set of ActionAttribute objects.
    • getVersionNumber

      public Long getVersionNumber()
      Specified by:
      getVersionNumber in interface Versioned
    • build

      public ActionDefinition build()
      Builds an instance of a Action based on the current state of the builder.
      Specified by:
      build in interface ModelBuilder
      Returns:
      the fully-constructed Action