|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krms.api.repository.context.ContextDefinition.Builder
public static final class ContextDefinition.Builder
A builder which can be used to construct ContextDefinition instances. Enforces the
constraints of the ContextDefinitionContract
. This class is the only means
by which a ContextDefinition
object can be constructed.
Method Summary | |
---|---|
ContextDefinition |
build()
Returns an instance of the object being built by this builder based on the current state of the builder. |
static ContextDefinition.Builder |
create(ContextDefinitionContract contract)
Creates a populates a builder with the data on the given ContextDefinitionContract. |
static ContextDefinition.Builder |
create(String namespace,
String name)
Creates a context definition builder with the given required values |
List<AgendaDefinition.Builder> |
getAgendas()
Returns the list of agendas AgendaDefinitionContract contained in the context definition. |
Map<String,String> |
getAttributes()
Returns a map of name/value pairs representing the attributes associated with this context. |
String |
getDescription()
Returns the description of the context definition. |
String |
getId()
The unique identifier for an object. |
String |
getName()
Returns the name of the context definition. |
String |
getNamespace()
Returns the namespace of the context definition. |
String |
getTypeId()
Returns the type id for the context definition. |
Long |
getVersionNumber()
Returns the version number for this object. |
boolean |
isActive()
The active indicator for an object. |
void |
setActive(boolean active)
Sets the active flag for the context that will be returned by this builder. |
void |
setAgendas(List<? extends AgendaDefinitionContract> agendaContracts)
Sets the agendas property of this context definition. |
void |
setAttributes(Map<String,String> attributes)
Sets the Map of attributes as name / value pairs. |
void |
setDescription(String description)
Sets the description for the context definition that will be created by this builder. |
void |
setId(String id)
Sets the id for the context definition that will be created by this builder. |
void |
setName(String name)
Sets the name for the context definition that will be created by this builder. |
void |
setNamespace(String namespace)
Sets the namespace code for the context definition that will be created by this builder. |
void |
setTypeId(String typeId)
Sets the typeId for the context definition that will be created by this builder. |
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 |
Method Detail |
---|
public static ContextDefinition.Builder create(String namespace, String name)
namespace
- the namespace code of the context definition to create, must not be null or blankname
- the name of the context definition to create, must not be null or blank
IllegalArgumentException
- if the given namespace is null or blank
IllegalArgumentException
- if the given name is null or blankpublic static ContextDefinition.Builder create(ContextDefinitionContract contract)
contract
- an object implementing the ContextDefinitionContract from which
to copy property values
IllegalArgumentException
- if the given contract is nullpublic ContextDefinition build()
ModelBuilder
build
in interface ModelBuilder
public Long getVersionNumber()
Versioned
getVersionNumber
in interface Versioned
public String getId()
Identifiable
getId
in interface Identifiable
public String getNamespace()
ContextDefinitionContract
getNamespace
in interface ContextDefinitionContract
public String getName()
ContextDefinitionContract
getName
in interface ContextDefinitionContract
public String getTypeId()
ContextDefinitionContract
getTypeId
in interface ContextDefinitionContract
public String getDescription()
ContextDefinitionContract
getDescription
in interface ContextDefinitionContract
public boolean isActive()
Inactivatable
isActive
in interface Inactivatable
public List<AgendaDefinition.Builder> getAgendas()
ContextDefinitionContract
AgendaDefinitionContract
contained in the context definition.
This method should never return null. An empty list is returned
if no agendas are associated with this context.
getAgendas
in interface ContextDefinitionContract
public Map<String,String> getAttributes()
ContextDefinitionContract
This method should never return null. An empty map is returned if no attributes are associated with the context.
getAttributes
in interface ContextDefinitionContract
public void setId(String id)
id
- the id to setpublic void setNamespace(String namespace)
namespace
- the namespace to set on this builder, must not be
null or blank
IllegalArgumentException
- if the given namespace code is null or blankpublic void setName(String name)
name
- the name to set on this builder, must not be
null or blank
IllegalArgumentException
- if the given name is null or blankpublic void setTypeId(String typeId)
typeId
- the typeId to setpublic void setDescription(String description)
description
- the descripition to setpublic void setActive(boolean active)
active
- the active flag to setpublic void setAgendas(List<? extends AgendaDefinitionContract> agendaContracts)
For each of the AgendaDefinitionContract
provided in the parameter list,
construct an AgendaDefinition from the builder of the provided contract, and save the agenda definitions
in a List of AgendaDefinition
agendaContracts
- a list of agenda definition contractspublic void setAttributes(Map<String,String> attributes)
attributes
- a Map of name value String pairs representing the attributes
associated with this contextpublic void setVersionNumber(Long versionNumber)
In general, this value should not be manually set on the builder,
but rather copied from an existing ContextDefinitionContract
when
invoking create(ContextDefinitionContract)
.
versionNumber
- the version number to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |