Class KrmsTypeAttribute.Builder
java.lang.Object
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:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of a KrmsTypeAttribute based on the current state of the builder.static KrmsTypeAttribute.BuilderCreates a builder from the given parameters.static KrmsTypeAttribute.Buildercreate(KrmsTypeAttributeContract contract) Creates a builder by populating it with data from the givenKrmsTypeAttributeContract.Returns the id of the KrmsAttributeDefinition of the attribute.getId()Returns the sequence number of the attribute within the KrmsTypeDefinition collection.Returns the id of the KrmsTypeDefinition to which the attribute appliesbooleanisActive()voidsetActive(boolean active) sets the active indicator valuevoidsetAttributeDefinitionId(String attributeDefinitionId) Sets the id of the KrmsAttributeDefinition that describes this attribute.voidSets the value of the id on this builder to the given value.voidsetSequenceNumber(Integer sequenceNumber) Sets the sequence number.voidSets the id of the KrmsTypeDefinition to which this attribute belongs.voidsetVersionNumber(Long versionNumber) Sets the version number for this object.
-
Method Details
-
create
public static KrmsTypeAttribute.Builder create(String typeId, String attributeDefinitionId, Integer sequenceNumber) Creates a builder from the given parameters.- Parameters:
typeId- the KrmsType IdattributeDefinitionId- The attributeDefinitionIdsequenceNumber-- 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
Creates a builder by populating it with data from the givenKrmsTypeAttributeContract.- 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
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
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
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
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
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
- Specified by:
getIdin interfaceIdentifiable
-
getTypeId
Description copied from interface:KrmsTypeAttributeContractReturns the id of the KrmsTypeDefinition to which the attribute appliesA 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:
getTypeIdin interfaceKrmsTypeAttributeContract- Returns:
- id for KrmsTypeDefinition related to the attribute.
-
getAttributeDefinitionId
Description copied from interface:KrmsTypeAttributeContractReturns 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:
getAttributeDefinitionIdin interfaceKrmsTypeAttributeContract- Returns:
- the attribute definition id
-
getSequenceNumber
Description copied from interface:KrmsTypeAttributeContractReturns 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:
getSequenceNumberin interfaceKrmsTypeAttributeContract- Returns:
- the sequence number of the attribute
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceInactivatable
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
build
Builds an instance of a KrmsTypeAttribute based on the current state of the builder.- Specified by:
buildin interfaceModelBuilder- Returns:
- the fully-constructed KrmsTypeAttribute
-