Class AgendaDefinition.Builder

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

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

    • create

      public static AgendaDefinition.Builder create(String id, String name, String typeId, String contextId)
      Create a builder with the given parameters.
      Parameters:
      id -
      name -
      typeId -
      contextId -
      Returns:
      Builder
    • create

      public static AgendaDefinition.Builder create(AgendaDefinitionContract contract)
      Creates a builder by populating it with data from the given AgendaDefinitionContract.
      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 agendaId)
      Sets the value of the id on this builder to the given value.
      Parameters:
      agendaId - the agenda id value to set, may be null, must not be blank

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

      Throws:
      IllegalArgumentException - if the id is blank
    • setName

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

      public void setTypeId(String typeId)
      Set the value of the type id on this builder to the given value.
      Parameters:
      typeId - the type id of the agenda to set
    • setContextId

      public void setContextId(String contextId)
      Set the value of the context id on this builder to the given value.
      Parameters:
      contextId - the context id of the agenda to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the name is null or blank
    • setActive

      public void setActive(boolean active)
      Set the value of the active indicator on this builder to the given value.
      Parameters:
      active - the active indicator of the agenda to set
    • setFirstItemId

      public void setFirstItemId(String firstItemId)
      Set the value of the first agenda item id on this builder to the given value.
      Parameters:
      firstItemId - the first agenda item of the agenda tree to set
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      Set the value of the remote/custom attributes on this builder to the given value.
      Parameters:
      attributes - the remote/custom attributes of the agenda to set
    • setVersionNumber

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

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

      public String getName()
      Description copied from interface: AgendaDefinitionContract
      Returns the name of the Agenda.
      Specified by:
      getName in interface AgendaDefinitionContract
      Returns:
      the name of the Agenda
    • getTypeId

      public String getTypeId()
      Description copied from interface: AgendaDefinitionContract
      Returns the KRMS type id of the Agenda.
      Specified by:
      getTypeId in interface AgendaDefinitionContract
      Returns:
      id for KRMS type related of the agenda
    • getContextId

      public String getContextId()
      Description copied from interface: AgendaDefinitionContract
      Returns the context id of the Agenda.
      Specified by:
      getContextId in interface AgendaDefinitionContract
      Returns:
      id for context relative to the agenda
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface Inactivatable
    • getFirstItemId

      public String getFirstItemId()
      Description copied from interface: AgendaDefinitionContract
      Returns the fist agenda item id to be executed in the Agenda. (Also known as the root of the agenda item / rules tree.)
      Specified by:
      getFirstItemId in interface AgendaDefinitionContract
      Returns:
      id of the first agenda item id of the agenda.
    • getAttributes

      public Map<String,String> getAttributes()
      Description copied from interface: AgendaDefinitionContract
      This method returns a list of custom/remote attributes associated with the agenda.
      Specified by:
      getAttributes in interface AgendaDefinitionContract
      Returns:
      a list of custom/remote attribute of the agenda.
    • getVersionNumber

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

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