public static final class ContextDefinition.Builder extends Object implements ContextDefinitionContract, ModelBuilder, Serializable
ContextDefinitionContract. This class is the only means
by which a ContextDefinition object can be constructed.| Modifier and Type | Method and Description |
|---|---|
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.
|
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 blankIllegalArgumentException - if the given namespace is null or blankIllegalArgumentException - 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 valuesIllegalArgumentException - if the given contract is nullpublic ContextDefinition build()
ModelBuilderbuild in interface ModelBuilderpublic Long getVersionNumber()
VersionedgetVersionNumber in interface Versionedpublic String getId()
IdentifiablegetId in interface Identifiablepublic String getNamespace()
ContextDefinitionContractgetNamespace in interface ContextDefinitionContractpublic String getName()
ContextDefinitionContractgetName in interface ContextDefinitionContractpublic String getTypeId()
ContextDefinitionContractgetTypeId in interface ContextDefinitionContractpublic String getDescription()
ContextDefinitionContractgetDescription in interface ContextDefinitionContractpublic boolean isActive()
InactivatableisActive in interface Inactivatablepublic List<AgendaDefinition.Builder> getAgendas()
ContextDefinitionContractAgendaDefinitionContract 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 ContextDefinitionContractpublic Map<String,String> getAttributes()
ContextDefinitionContractThis method should never return null. An empty map is returned if no attributes are associated with the context.
getAttributes in interface ContextDefinitionContractpublic 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 blankIllegalArgumentException - 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 blankIllegalArgumentException - 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 setCopyright © 2005–2015 The Kuali Foundation. All rights reserved.