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

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

public static class KrmsTypeDefinition.Builder
extends Object
implements KrmsTypeDefinitionContract, ModelBuilder, Serializable

This builder is used to construct instances of KrmsTypeDefinition. It enforces the constraints of the KrmsTypeDefinitionContract.

See Also:
Serialized Form

Method Summary
 KrmsTypeDefinition.Builder attributes(List<KrmsTypeAttribute.Builder> attributes)
          fluent interface that sets the attributes of KrmsTypeDefinition builder.
 KrmsTypeDefinition build()
          Builds an instance of a KrmsTypeDefinition based on the current state of the builder.
static KrmsTypeDefinition.Builder create(KrmsTypeDefinitionContract contract)
          Creates a builder by populating it with data from the given KrmsTypeDefinitionContract.
static KrmsTypeDefinition.Builder create(String name, String namespace)
          Creates a KrmsTypeDefinition builder from the given parameters.
 List<KrmsTypeAttribute.Builder> getAttributes()
          Returns a list of attributes associated with the KRMS type definition.
 String getId()
          The unique identifier for an object.
 String getName()
          Returns the name of the KrmsTypeDefinition.
 String getNamespace()
          Returns the namespace to which the KrmsTypeDefinition belongs.
 String getServiceName()
          Returns the name of the service used to resolve attribute values.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 KrmsTypeDefinition.Builder serviceName(String serviceName)
          fluent interface that sets the serviceName field of the Builder.
 void setActive(boolean active)
          sets the active indicator value
 void setAttributes(List<KrmsTypeAttribute.Builder> attributes)
          sets the List of attributes related to this KrmsTypeDefinition.
 void setId(String id)
          Sets the value of the id on this builder to the given value.
 void setName(String name)
          Sets the name of the KrmsTypeDefinition
 void setNamespace(String namespace)
          Sets the namespace of the KrmsTypeDefinition
 void setServiceName(String serviceName)
          Sets the name of the KRMS type service
 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

serviceName

public KrmsTypeDefinition.Builder serviceName(String serviceName)
fluent interface that sets the serviceName field of the Builder.

Parameters:
serviceName - the service used to resolve attribute values
Returns:
a Builder object with the serviceName field set

attributes

public KrmsTypeDefinition.Builder attributes(List<KrmsTypeAttribute.Builder> attributes)
fluent interface that sets the attributes of KrmsTypeDefinition builder.

Parameters:
attributes - List of KrmsTypeAttribute builder objects. KrmsTypeAttribute.Builder
Returns:
a Builder object with the attributes collection set.

create

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

Parameters:
name - of the KrmsTypeDefinition
namespace - to which the KrmsTypeDefinition belongs
Returns:
an instance of the builder with the fields already populated
Throws:
IllegalArgumentException - if the either the name or namespace is null or blank

create

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

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

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; can be null; a null id is an indicator the this has not yet been persisted to the database.

setName

public void setName(String name)
Sets the name of the KrmsTypeDefinition

Parameters:
name - string value to assign to the name; cannot be null or blank
Throws:
IllegalArgumentException - if the name is null or blank

setNamespace

public void setNamespace(String namespace)
Sets the namespace of the KrmsTypeDefinition

Parameters:
namespace - string value to assign to the namespace; cannot be null or blank
Throws:
IllegalArgumentException - if the name is null or blank

setServiceName

public void setServiceName(String serviceName)
Sets the name of the KRMS type service

Parameters:
serviceName - can be null.

setAttributes

public void setAttributes(List<KrmsTypeAttribute.Builder> attributes)
sets the List of attributes related to this KrmsTypeDefinition.

Parameters:
attributes - list of KrmsTypeAttribute.Builder representing the attributes assigned to this KrmsTypeDefinition; List may be empty, but not null

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: KrmsTypeDefinitionContract
Returns the name of the KrmsTypeDefinition. All KrmsTypeDefinitions have a name, 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 KrmsTypeDefinitionContract
Returns:
the name of this KrmsTypeDefinition

getNamespace

public String getNamespace()
Description copied from interface: KrmsTypeDefinitionContract
Returns the namespace to which the KrmsTypeDefinition belongs. All type definitions exist within a namespace. This value can not be null or blank. The combination of name and namespace must be unique within the entire KRMS system.

Specified by:
getNamespace in interface KrmsTypeDefinitionContract
Returns:
the namespace of this KrmsTypeDefinition

getServiceName

public String getServiceName()
Description copied from interface: KrmsTypeDefinitionContract
Returns the name of the service used to resolve attribute values. The service name may be null or blank.

Specified by:
getServiceName in interface KrmsTypeDefinitionContract
Returns:
the service name of this KrmsTypeDefinition

getAttributes

public List<KrmsTypeAttribute.Builder> getAttributes()
Description copied from interface: KrmsTypeDefinitionContract
Returns a list of attributes associated with the KRMS type definition. This can be empty, but will never be null. If no attribute definitions are associated with the KRMS type then this will return an empty collection.

Specified by:
getAttributes in interface KrmsTypeDefinitionContract
Returns:
the list of KrmsTypeAttributeContract attribute definition contracts

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

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


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