org.kuali.rice.coreservice.api.namespace
Class Namespace.Builder

java.lang.Object
  extended by org.kuali.rice.coreservice.api.namespace.Namespace.Builder
All Implemented Interfaces:
Serializable, Inactivatable, Coded, GloballyUnique, Versioned, ModelBuilder, NamespaceContract
Enclosing class:
Namespace

public static final class Namespace.Builder
extends Object
implements NamespaceContract, ModelBuilder, Serializable

This builder is used to construct instances of Namespace. It enforces the constraints of the NamespaceContract.

See Also:
Serialized Form

Method Summary
 Namespace build()
          Builds an instance of a Namespace based on the current state of the builder.
static Namespace.Builder create(NamespaceContract contract)
          Creates a builder by populating it with data from the given NamespaceContract.
static Namespace.Builder create(String code)
          Creates a builder from the given namespace code and application id.
static Namespace.Builder create(String code, String applicationId)
          Creates a builder from the given namespace code and application id.
 String getApplicationId()
          This the id of the application which owns this Namespace.
 String getCode()
          The code value for this object.
 String getName()
          This the name for the Namespace.
 String getObjectId()
          Return the globally unique object id of this object.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
           
 void setApplicationId(String applicationId)
          Sets the value of the applicationId on this builder to the given value.
 void setCode(String code)
          Sets the value of the code on this builder to the given value.
 void setName(String name)
           
 void setObjectId(String objectId)
           
 void setVersionNumber(Long versionNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Namespace.Builder create(String code)
Creates a builder from the given namespace code and application id.

Parameters:
code - the namespace code to use when constructing this builder
Returns:
an instance of the builder with the given data already populated
Throws:
IllegalArgumentException - if the code or applicationId are null or blank

create

public static Namespace.Builder create(String code,
                                       String applicationId)
Creates a builder from the given namespace code and application id.

Parameters:
code - the namespace code to use when constructing this builder
applicationId - the application id to use when constructing this builder
Returns:
an instance of the builder with the given data already populated
Throws:
IllegalArgumentException - if the code or applicationId are null or blank

create

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

Parameters:
contract - the contract from which to populate this builder
Returns:
an instance of the builder populated with data from the contract

setCode

public void setCode(String code)
Sets the value of the code on this builder to the given value.

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

setApplicationId

public void setApplicationId(String applicationId)
Sets the value of the applicationId on this builder to the given value.

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

setVersionNumber

public void setVersionNumber(Long versionNumber)

setObjectId

public void setObjectId(String objectId)

getName

public String getName()
Description copied from interface: NamespaceContract
This the name for the Namespace. This can be null or a blank string.

Specified by:
getName in interface NamespaceContract
Returns:
name

setName

public void setName(String name)

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.

setActive

public void setActive(boolean active)

getCode

public String getCode()
Description copied from interface: Coded
The code value for this object. In general a code value cannot be null or a blank string.

Specified by:
getCode in interface Coded
Returns:
the code value for this object.

getApplicationId

public String getApplicationId()
Description copied from interface: NamespaceContract
This the id of the application which owns this Namespace. If this namespace has no application owner, then this method will return null.

It is a way of assigning the Namespace to a specific rice application or rice ecosystem.

Specified by:
getApplicationId in interface NamespaceContract
Returns:
application id

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

getObjectId

public String getObjectId()
Description copied from interface: GloballyUnique
Return the globally unique object id of this object. In general, this value should only be null if the object has not yet been stored to a persistent data store.

Specified by:
getObjectId in interface GloballyUnique
Returns:
the objectId of this object, or null if it has not been set yet

build

public Namespace build()
Builds an instance of a Namespace based on the current state of the builder.

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


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