org.kuali.rice.krms.api.repository.agenda
Class AgendaDefinition.Builder

java.lang.Object
  extended by 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:
Serialized Form

Method Summary
 AgendaDefinition build()
          Builds an instance of a Agenda based on the current state of the builder.
static AgendaDefinition.Builder create(AgendaDefinitionContract contract)
          Creates a builder by populating it with data from the given AgendaDefinitionContract.
static AgendaDefinition.Builder create(String id, String name, String typeId, String contextId)
          Create a builder with the given parameters.
 Map<String,String> getAttributes()
          This method returns a list of custom/remote attributes associated with the agenda.
 String getContextId()
          Returns the context id of the Agenda.
 String getFirstItemId()
          Returns the fist agenda item id to be executed in the Agenda.
 String getId()
          The unique identifier for an object.
 String getName()
          Returns the name of the Agenda.
 String getTypeId()
          Returns the KRMS type id of the Agenda.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
          Set the value of the active indicator on this builder to the given value.
 void setAttributes(Map<String,String> attributes)
          Set the value of the remote/custom attributes on this builder to the given value.
 void setContextId(String contextId)
          Set the value of the context id on this builder to the given value.
 void setFirstItemId(String firstItemId)
          Set the value of the first agenda item id on this builder to the given value.
 void setId(String agendaId)
          Sets the value of the id on this builder to the given value.
 void setName(String name)
          Set the value of the name on this builder to the given value.
 void setTypeId(String typeId)
          Set the value of the type id on this builder to the given value.
 void setVersionNumber(Long versionNumber)
          Sets the version number on this builder to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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()
Description copied from interface: Identifiable
The unique identifier for an object. This can be null.

Specified by:
getId in interface Identifiable
Returns:
the id

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()
Description copied from interface: Inactivatable
The active indicator for an object.

Specified by:
isActive in interface Inactivatable
Returns:
true if active false if not.

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()
Description copied from interface: Versioned
Returns the version number for this object. In general, this value should only be null if the object has not yet been stored to a persistent data store. This version number is generally used for the purposes of optimistic locking.

Specified by:
getVersionNumber in interface Versioned
Returns:
the version number, or null if one has not been assigned yet

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


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.