Class AgendaItemDefinition.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.agenda.AgendaItemDefinition.Builder
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelBuilder, AgendaItemDefinitionContract
Enclosing class:
AgendaItemDefinition

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

    • create

      public static AgendaItemDefinition.Builder create(String id, String agendaId)
      Create a builder with the given parameters.
      Parameters:
      id -
      agendaId -
      Returns:
      Builder
    • create

      Creates a builder by populating it with data from the given AgendaItemDefinitionContract.
      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 agendaItemId)
      Sets the value of the id on this builder to the given value.
      Parameters:
      agendaItemId - the agenda item id to set, may be null, must not be blank

      The agenda item id is generated by the system. For new agenda items (not yet persisted) this field is null. For existing agenda items this field is the generated id.

      Throws:
      IllegalArgumentException - if the id is blank
    • setAgendaId

      public void setAgendaId(String agendaId)
      Set the value of the agenda id on this builder to the given value.
      Parameters:
      agendaId - the agenda id of the agenda item to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the agenda id is null or blank
    • setRuleId

      public void setRuleId(String ruleId)
      Set the value of the rule id on this builder to the given value.
      Parameters:
      ruleId - the rule id of the agenda item to set
    • setSubAgendaId

      public void setSubAgendaId(String subAgendaId)
      Set the value of the sub agenda id on this builder to the given value.
      Parameters:
      subAgendaId - the sub agenda id of the agenda item to set
    • setWhenTrueId

      public void setWhenTrueId(String whenTrueId)
      Set the value of the agenda item id for the "when true" condition on this builder to the given value.
      Parameters:
      whenTrueId - the agenda item id for the "when true" condition of the agenda item to set
    • setWhenFalseId

      public void setWhenFalseId(String whenFalseId)
      Set the value of the agenda item id for the "when false" condition on this builder to the given value.
      Parameters:
      whenFalseId - the agenda item id for the "when false" condition of the agenda item to set
    • setAlwaysId

      public void setAlwaysId(String alwaysId)
      Set the value of the agenda item id for the "always" condition on this builder to the given value.
      Parameters:
      alwaysId - the agenda item id for the "always" condition of the agenda item to set
    • setRule

      public void setRule(RuleDefinition.Builder rule)
      Set the value of the rule on this builder to the given value.
      Parameters:
      rule - the rule of the agenda item to set
    • setSubAgenda

      public void setSubAgenda(AgendaDefinition.Builder subAgenda)
      Set the value of the sub agenda on this builder to the given value.
      Parameters:
      subAgenda - the sub agenda of the agenda item to set
    • setWhenTrue

      public void setWhenTrue(AgendaItemDefinition.Builder whenTrue)
      Set the value of the agenda item for the "when true" condition on this builder to the given value. Has the additional side effect of setting whenTrueId to the ID value of the {{whenTrue}} argument.
      Parameters:
      whenTrue - the agenda item for the "when true" condition of the agenda item to set
    • setWhenFalse

      public void setWhenFalse(AgendaItemDefinition.Builder whenFalse)
      Set the value of the agenda item for the "when false" condition on this builder to the given value. Has the additional side effect of setting whenTrueId to the ID value of the {{whenFalse}} argument.
      Parameters:
      whenFalse - the agenda item for the "when false" condition of the agenda item to set
    • setAlways

      public void setAlways(AgendaItemDefinition.Builder always)
      Set the value of the agenda item for the "always" condition on this builder to the given value. Has the additional side effect of setting {{whenTrueId}} to the ID value of the always argument.
      Parameters:
      always - the agenda item for the "always" condition of the agenda item to set
    • setVersionNumber

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

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

      public String getAgendaId()
      Description copied from interface: AgendaItemDefinitionContract
      Returns the agenda id to which the agenda item belongs.
      Specified by:
      getAgendaId in interface AgendaItemDefinitionContract
      Returns:
      id for the agenda associated with the agenda item
    • getRuleId

      public String getRuleId()
      Description copied from interface: AgendaItemDefinitionContract
      Returns the rule id associated with the agenda item.
      Specified by:
      getRuleId in interface AgendaItemDefinitionContract
      Returns:
      ID of the Rule associated with the agenda item
    • getSubAgendaId

      public String getSubAgendaId()
      Description copied from interface: AgendaItemDefinitionContract
      This is ID of the SubAgenda associated with this AgendaItemDefinition. Each AgendaItemDefinition has either a Rule or a SubAgenda associated with it, but not both.
      Specified by:
      getSubAgendaId in interface AgendaItemDefinitionContract
      Returns:
      ID of the SubAgenda associated with the AgendaItemDefinition
    • getWhenTrueId

      public String getWhenTrueId()
      Description copied from interface: AgendaItemDefinitionContract
      This is ID of the next AgendaItemDefinition to be executed if the Rule associated AgendaItemDefinition evaluates to true.
      Specified by:
      getWhenTrueId in interface AgendaItemDefinitionContract
      Returns:
      ID of the next AgendaItemDefinition
    • getWhenFalseId

      public String getWhenFalseId()
      Description copied from interface: AgendaItemDefinitionContract
      This is ID of the next AgendaItemDefinition to be executed if the Rule associated AgendaItemDefinition evaluates to false.
      Specified by:
      getWhenFalseId in interface AgendaItemDefinitionContract
      Returns:
      ID of the next AgendaItemDefinition
    • getAlwaysId

      public String getAlwaysId()
      Description copied from interface: AgendaItemDefinitionContract
      This is ID of the next AgendaItemDefinition to be executed after following any defined true or false actions.
      Specified by:
      getAlwaysId in interface AgendaItemDefinitionContract
      Returns:
      ID of the next AgendaItemDefinition
    • getRule

      public RuleDefinition.Builder getRule()
      Description copied from interface: AgendaItemDefinitionContract
      This method returns the Rule associated with this AgendaItemDefinition.
      Specified by:
      getRule in interface AgendaItemDefinitionContract
      Returns:
      an immutable representation of the Rule
    • getSubAgenda

      public AgendaDefinition.Builder getSubAgenda()
      Description copied from interface: AgendaItemDefinitionContract
      This method returns the SubAgenda associated with this AgendaItemDefinition.
      Specified by:
      getSubAgenda in interface AgendaItemDefinitionContract
      Returns:
      an immutable representation of the SubAgenda
    • getWhenTrue

      public AgendaItemDefinition.Builder getWhenTrue()
      Description copied from interface: AgendaItemDefinitionContract
      This method returns the next AgendaItemDefinition to be executed if the Rule associated with this AgendaItemDefinition evaluates to true.
      Specified by:
      getWhenTrue in interface AgendaItemDefinitionContract
      Returns:
      an immutable representation of the next AgendaItemDefinition
    • getWhenFalse

      public AgendaItemDefinition.Builder getWhenFalse()
      Description copied from interface: AgendaItemDefinitionContract
      This method returns the next AgendaItemDefinition to be executed if the Rule associated with this AgendaItemDefinition evaluates to false.
      Specified by:
      getWhenFalse in interface AgendaItemDefinitionContract
      Returns:
      an immutable representation of the next AgendaItemDefinition
    • getAlways

      public AgendaItemDefinition.Builder getAlways()
      Description copied from interface: AgendaItemDefinitionContract
      This is ID of the next AgendaItemDefinition to be executed after following any defined true or false actions.
      Specified by:
      getAlways in interface AgendaItemDefinitionContract
      Returns:
      an immutable representation of the next AgendaItemDefinition
    • getVersionNumber

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

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