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

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

public static class KrmsTypeAttribute.Builder
extends Object
implements KrmsTypeAttributeContract, ModelBuilder, Serializable

This builder is used to construct instances of KrmsTypeAttribute.

See Also:
Serialized Form

Method Summary
 KrmsTypeAttribute build()
          Builds an instance of a KrmsTypeAttribute based on the current state of the builder.
static KrmsTypeAttribute.Builder create(KrmsTypeAttributeContract contract)
          Creates a builder by populating it with data from the given KrmsTypeAttributeContract.
static KrmsTypeAttribute.Builder create(String typeId, String attributeDefinitionId, Integer sequenceNumber)
          Creates a builder from the given parameters.
 String getAttributeDefinitionId()
          Returns the id of the KrmsAttributeDefinition of the attribute.
 String getId()
          The unique identifier for an object.
 Integer getSequenceNumber()
          Returns the sequence number of the attribute within the KrmsTypeDefinition collection.
 String getTypeId()
          Returns the id of the KrmsTypeDefinition to which the attribute applies
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
          sets the active indicator value
 void setAttributeDefinitionId(String attributeDefinitionId)
          Sets the id of the KrmsAttributeDefinition that describes this attribute.
 void setId(String id)
          Sets the value of the id on this builder to the given value.
 void setSequenceNumber(Integer sequenceNumber)
          Sets the sequence number.
 void setTypeId(String typeId)
          Sets the id of the KrmsTypeDefinition to which this attribute belongs.
 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

create

public static KrmsTypeAttribute.Builder create(String typeId,
                                               String attributeDefinitionId,
                                               Integer sequenceNumber)
Creates a builder from the given parameters.

Parameters:
typeId - the KrmsType Id
attributeDefinitionId - The attributeDefinitionId
sequenceNumber -
Returns:
an instance of the builder with the fields already populated
Throws:
IllegalArgumentException - if the either the id, name or namespace is null or blank

create

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

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.

setTypeId

public void setTypeId(String typeId)
Sets the id of the KrmsTypeDefinition to which this attribute belongs.

Parameters:
typeId - the id of the KrmsTypeDefinition; may not be null or blank
Throws:
IllegalArgumentException - if the typeId is null or blank

setAttributeDefinitionId

public void setAttributeDefinitionId(String attributeDefinitionId)
Sets the id of the KrmsAttributeDefinition that describes this attribute.

Parameters:
attributeDefinitionId - id of the KrmsAttributeDefinition; may not be null or blank
Throws:
IllegalArgumentException - if the attributeDefinitionId is null or blank

setSequenceNumber

public void setSequenceNumber(Integer sequenceNumber)
Sets the sequence number. This represents the order of the attributes within the KrmsTypeDefinition.

Parameters:
sequenceNumber - the order of the attribute in the attribute list; cannot be null
Throws:
IllegalArgumentException - if the sequenceNumber is 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

getTypeId

public String getTypeId()
Description copied from interface: KrmsTypeAttributeContract
Returns the id of the KrmsTypeDefinition to which the attribute applies

A KRMS type definition has zero or more attributes associated with it. The id field indicates which type definition this attribute is associated with. It is the id of a KrmsTypeDefinition related to the attribute. This required field may not be null or blank.

Specified by:
getTypeId in interface KrmsTypeAttributeContract
Returns:
id for KrmsTypeDefinition related to the attribute.

getAttributeDefinitionId

public String getAttributeDefinitionId()
Description copied from interface: KrmsTypeAttributeContract
Returns the id of the KrmsAttributeDefinition of the attribute.

The attribute definition contains metadata about the attribute. This is a required field and may not be null or blank. Many attributes may share the same attribute definition.

Specified by:
getAttributeDefinitionId in interface KrmsTypeAttributeContract
Returns:
the attribute definition id

getSequenceNumber

public Integer getSequenceNumber()
Description copied from interface: KrmsTypeAttributeContract
Returns the sequence number of the attribute within the KrmsTypeDefinition collection.

The list of attributes is an ordered list. This value represents the position in the list and cannot be null.

Specified by:
getSequenceNumber in interface KrmsTypeAttributeContract
Returns:
the sequence number 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 KrmsTypeAttribute build()
Builds an instance of a KrmsTypeAttribute based on the current state of the builder.

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


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