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 Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of a Agenda based on the current state of the builder.static AgendaDefinition.BuilderCreate a builder with the given parameters.static AgendaDefinition.Buildercreate(AgendaDefinitionContract contract) Creates a builder by populating it with data from the givenAgendaDefinitionContract.This method returns a list of custom/remote attributes associated with the agenda.Returns the context id of the Agenda.Returns the fist agenda item id to be executed in the Agenda.getId()getName()Returns the name of the Agenda.Returns the KRMS type id of the Agenda.booleanisActive()voidsetActive(boolean active) Set the value of the active indicator on this builder to the given value.voidsetAttributes(Map<String, String> attributes) Set the value of the remote/custom attributes on this builder to the given value.voidsetContextId(String contextId) Set the value of the context id on this builder to the given value.voidsetFirstItemId(String firstItemId) Set the value of the first agenda item id on this builder to the given value.voidSets the value of the id on this builder to the given value.voidSet the value of the name on this builder to the given value.voidSet the value of the type id on this builder to the given value.voidsetVersionNumber(Long versionNumber) Sets the version number on this builder to the given value.
-
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
Creates a builder by populating it with data from the givenAgendaDefinitionContract.- 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
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 blankThe 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
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
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
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
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
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
Sets the version number on this builder to the given value.- Parameters:
versionNumber- the version number to set
-
getId
- Specified by:
getIdin interfaceIdentifiable
-
getName
Description copied from interface:AgendaDefinitionContractReturns the name of the Agenda.- Specified by:
getNamein interfaceAgendaDefinitionContract- Returns:
- the name of the Agenda
-
getTypeId
Description copied from interface:AgendaDefinitionContractReturns the KRMS type id of the Agenda.- Specified by:
getTypeIdin interfaceAgendaDefinitionContract- Returns:
- id for KRMS type related of the agenda
-
getContextId
Description copied from interface:AgendaDefinitionContractReturns the context id of the Agenda.- Specified by:
getContextIdin interfaceAgendaDefinitionContract- Returns:
- id for context relative to the agenda
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceInactivatable
-
getFirstItemId
Description copied from interface:AgendaDefinitionContractReturns the fist agenda item id to be executed in the Agenda. (Also known as the root of the agenda item / rules tree.)- Specified by:
getFirstItemIdin interfaceAgendaDefinitionContract- Returns:
- id of the first agenda item id of the agenda.
-
getAttributes
Description copied from interface:AgendaDefinitionContractThis method returns a list of custom/remote attributes associated with the agenda.- Specified by:
getAttributesin interfaceAgendaDefinitionContract- Returns:
- a list of custom/remote attribute of the agenda.
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
build
Builds an instance of a Agenda based on the current state of the builder.- Specified by:
buildin interfaceModelBuilder- Returns:
- the fully-constructed Agenda
-