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

Field Summary
private  boolean active
           
private  Map<String,String> attributes
           
private  String contextId
           
private  String firstItemId
           
private  String id
           
private  String name
           
private  String namespaceCode
           
private static long serialVersionUID
           
private  String typeId
           
private  Long versionNumber
           
 
Constructor Summary
private AgendaDefinition.Builder(String id, String name, String namespaceCode, String typeId, String contextId)
          Private constructor for creating a builder with all of it's required attributes.
 
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 namespaceCode, String typeId, String contextId)
           
 Map<String,String> getAttributes()
          This method returns a list of attributes associated with the Agenda
 String getContextId()
          This is the ID of the Context relative to the Agenda.
 String getFirstItemId()
          This is the ID of the first AgendaItem to be executed in the Agenda.
 String getId()
          The unique identifier for an object.
 String getName()
          This is the name of the Agenda
 String getNamespaceCode()
          This is the namespace of the Agenda
 String getTypeId()
          This is the KrmsType of the Agenda
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
           
 void setAttributes(Map<String,String> attributes)
           
 void setContextId(String contextId)
           
 void setFirstItemId(String firstItemId)
           
 void setId(String agendaId)
          Sets the value of the id on this builder to the given value.
 void setName(String name)
           
 void setNamespaceCode(String namespaceCode)
           
 void setTypeId(String typeId)
           
 void setVersionNumber(Long versionNumber)
          Sets the version number for the style that will be returned by this builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

id

private String id

name

private String name

namespaceCode

private String namespaceCode

typeId

private String typeId

contextId

private String contextId

active

private boolean active

firstItemId

private String firstItemId

attributes

private Map<String,String> attributes

versionNumber

private Long versionNumber
Constructor Detail

AgendaDefinition.Builder

private AgendaDefinition.Builder(String id,
                                 String name,
                                 String namespaceCode,
                                 String typeId,
                                 String contextId)
Private constructor for creating a builder with all of it's required attributes.

Method Detail

create

public static AgendaDefinition.Builder create(String id,
                                              String name,
                                              String namespaceCode,
                                              String typeId,
                                              String contextId)

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

setId

public void setId(String agendaId)
Sets the value of the id on this builder to the given value.

Parameters:
id - the id value to set, must not be null or blank
Throws:
IllegalArgumentException - if the id is null or blank

setName

public void setName(String name)

setNamespaceCode

public void setNamespaceCode(String namespaceCode)

setTypeId

public void setTypeId(String typeId)

setContextId

public void setContextId(String contextId)

setActive

public void setActive(boolean active)

setFirstItemId

public void setFirstItemId(String firstItemId)

setAttributes

public void setAttributes(Map<String,String> attributes)

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the version number for the style that will be returned by this builder.

In general, this value should not be manually set on the builder, but rather copied from an existing ContextDefinitionContract when invoking ContextDefinition.Builder.create(ContextDefinitionContract).

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
This is the name of the Agenda

name - the name of the Agenda

Specified by:
getName in interface AgendaDefinitionContract
Returns:
the name of the Agenda

getNamespaceCode

public String getNamespaceCode()
Description copied from interface: AgendaDefinitionContract
This is the namespace of the Agenda

The namespace of the Agenda

Specified by:
getNamespaceCode in interface AgendaDefinitionContract
Returns:
the namespace of the Agenda

getTypeId

public String getTypeId()
Description copied from interface: AgendaDefinitionContract
This is the KrmsType 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
This is the ID of the Context relative to 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
This is the ID of the first AgendaItem to be executed in the Agenda.

Specified by:
getFirstItemId in interface AgendaDefinitionContract
Returns:
id of the first AgendaItem.

getAttributes

public Map<String,String> getAttributes()
Description copied from interface: AgendaDefinitionContract
This method returns a list of attributes associated with the Agenda

Specified by:
getAttributes in interface AgendaDefinitionContract
Returns:
a list of AgendaAttribute objects.

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 © 2004-2011 The Kuali Foundation. All Rights Reserved.