org.kuali.rice.krms.api.repository.type
Class KrmsAttributeDefinition.Builder

java.lang.Object
  extended by org.kuali.rice.krms.api.repository.type.KrmsAttributeDefinition.Builder
All Implemented Interfaces:
Serializable, Inactivatable, Identifiable, Versioned, ModelBuilder, KrmsAttributeDefinitionContract
Enclosing class:
KrmsAttributeDefinition

public static class KrmsAttributeDefinition.Builder
extends Object
implements KrmsAttributeDefinitionContract, ModelBuilder, Serializable

This builder is used to construct instances of KrmsAttributeDefinition. It enforces the constraints of the KrmsAttributeDefinitionContract.

See Also:
Serialized Form

Method Summary
 KrmsAttributeDefinition build()
          Builds an instance of a CampusType based on the current state of the builder.
 KrmsAttributeDefinition.Builder componentName(String componentName)
          fluent interface that sets the componentName of the KrmsAttributeDefinition.
static KrmsAttributeDefinition.Builder create(KrmsAttributeDefinitionContract contract)
          Creates a builder by populating it with data from the given KrmsAttributeDefinitionContract.
static KrmsAttributeDefinition.Builder create(String id, String name, String namespace)
          Creates a builder from the given parameters.
 String getComponentName()
          Returns the name of the component used to display the attribute.
 String getDescription()
          Returns the description of the attribute.
 String getId()
          The unique identifier for an object.
 String getLabel()
          Returns the label of this attribute definition.
 String getName()
          Returns the name of this attribute definition.
 String getNamespace()
          Returns the namespace of this attribute definition.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 KrmsAttributeDefinition.Builder label(String label)
          fluent interface that sets the label of the KrmsAttributeDefinition.
 void setActive(boolean active)
          sets the active indicator value
 void setComponentName(String componentName)
          sets the name of the component used to display the attribute
 void setDescription(String description)
          sets the description of the attribute
 void setId(String id)
          Sets the value of the id on this builder to the given value.
 void setLabel(String label)
          sets the label to be displayed with the attribute.
 void setName(String name)
          sets the name of the attribute.
 void setNamespace(String namespace)
          sets the namespace of the attribute.
 void setVersionNumber(Long versionNumber)
          Sets the version number for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

label

public KrmsAttributeDefinition.Builder label(String label)
fluent interface that sets the label of the KrmsAttributeDefinition.

Parameters:
label - the label used when the attribute is displayed; may be null or blank
Returns:
a Builder object with the label attribute set

componentName

public KrmsAttributeDefinition.Builder componentName(String componentName)
fluent interface that sets the componentName of the KrmsAttributeDefinition.

Parameters:
componentName - the name of the component used to display the attribute; can be null or blank
Returns:
a Builder object with the componentName set

create

public static KrmsAttributeDefinition.Builder create(String id,
                                                     String name,
                                                     String namespace)
Creates a builder from the given parameters.

Parameters:
id - the KrmsAttributeDefinition id
name - the KrmsAttributeDefinition name
namespace - the KrmsAttributeDefinition namespace
Returns:
an instance of the builder with the fields already populated
Throws:
IllegalArgumentException - if either the id, name or namespace is null or blank

create

public static KrmsAttributeDefinition.Builder create(KrmsAttributeDefinitionContract contract)
Creates a builder by populating it with data from the given KrmsAttributeDefinitionContract.

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 or blank

setId

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

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

setName

public void setName(String name)
sets the name of the attribute. must not be null or blank.

Parameters:
name - the name of the attribute;
Throws:
IllegalArgumentException - if the name is non-null and blank

setNamespace

public void setNamespace(String namespace)
sets the namespace of the attribute. must not be null or blank.

Parameters:
namespace - the namespace of the attribute;
Throws:
IllegalArgumentException - if the namespace is non-null and blank

setLabel

public void setLabel(String label)
sets the label to be displayed with the attribute.

Parameters:
label - string to display as label; May be null or empty

setDescription

public void setDescription(String description)
sets the description of the attribute

Parameters:
description - string; Optional, may be null or empty

setComponentName

public void setComponentName(String componentName)
sets the name of the component used to display the attribute

Parameters:
componentName; - May be null or empty

setActive

public void setActive(boolean active)
sets the active indicator value

Parameters:
active - boolean value to set

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets 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.

Parameters:
versionNumber - the version number, or null if one has not been assigned yet.

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: KrmsAttributeDefinitionContract
Returns the name of this attribute definition.

All attribute definitions have a name and namespace, so this value can not be null or blank. The combination of name and namespace must be unique within the entire KRMS system.

Specified by:
getName in interface KrmsAttributeDefinitionContract
Returns:
name for this attribute definition

getNamespace

public String getNamespace()
Description copied from interface: KrmsAttributeDefinitionContract
Returns the namespace of this attribute definition.

The namespace provides scope of the the attribute definition. All attribute definition have a name and namespace, so this field may not be null or blank. The combination of name and namespace must be unique within the entire KRMS system.

Specified by:
getNamespace in interface KrmsAttributeDefinitionContract
Returns:
the namespace of this attribute definition

getComponentName

public String getComponentName()
Description copied from interface: KrmsAttributeDefinitionContract
Returns the name of the component used to display the attribute.

Specified by:
getComponentName in interface KrmsAttributeDefinitionContract
Returns:
the component name of the of the attribute

getLabel

public String getLabel()
Description copied from interface: KrmsAttributeDefinitionContract
Returns the label of this attribute definition.

This is an optional field and may be null or blank.

Specified by:
getLabel in interface KrmsAttributeDefinitionContract
Returns:
the label to be used when displaying the attribute

getDescription

public String getDescription()
Description copied from interface: KrmsAttributeDefinitionContract
Returns the description of the attribute.

This is an option field and may be null or blank.

Specified by:
getDescription in interface KrmsAttributeDefinitionContract
Returns:
a text description of the attribute

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.

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 KrmsAttributeDefinition build()
Builds an instance of a CampusType based on the current state of the builder.

Specified by:
build in interface ModelBuilder
Returns:
the fully-constructed CampusType


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