Class KrmsTypeDefinition.Builder
java.lang.Object
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:
-
Method Summary
Modifier and TypeMethodDescriptionattributes(List<KrmsTypeAttribute.Builder> attributes) fluent interface that sets the attributes of KrmsTypeDefinition builder.build()Builds an instance of a KrmsTypeDefinition based on the current state of the builder.static KrmsTypeDefinition.BuilderCreates a KrmsTypeDefinition builder from the given parameters.static KrmsTypeDefinition.Buildercreate(KrmsTypeDefinitionContract contract) Creates a builder by populating it with data from the givenKrmsTypeDefinitionContract.Returns a list of attributes associated with the KRMS type definition.getId()getName()Returns the name of the KrmsTypeDefinition.Returns the namespace to which the KrmsTypeDefinition belongs.Returns the name of the service used to resolve attribute values.booleanisActive()serviceName(String serviceName) fluent interface that sets the serviceName field of the Builder.voidsetActive(boolean active) sets the active indicator valuevoidsetAttributes(List<KrmsTypeAttribute.Builder> attributes) sets the List of attributes related to this KrmsTypeDefinition.voidSets the value of the id on this builder to the given value.voidSets the name of the KrmsTypeDefinitionvoidsetNamespace(String namespace) Sets the namespace of the KrmsTypeDefinitionvoidsetServiceName(String serviceName) Sets the name of the KRMS type servicevoidsetVersionNumber(Long versionNumber) Sets the version number for this object.
-
Method Details
-
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
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
Creates a KrmsTypeDefinition builder from the given parameters.- Parameters:
name- of the KrmsTypeDefinitionnamespace- 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
Creates a builder by populating it with data from the givenKrmsTypeDefinitionContract.- 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.- Throws:
IllegalArgumentException- if the id is blank
-
setName
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
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
Sets the name of the KRMS type service- Parameters:
serviceName- can be null.
-
setAttributes
sets the List of attributes related to this KrmsTypeDefinition.- Parameters:
attributes- list ofKrmsTypeAttribute.Builderrepresenting 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
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
-
getName
Description copied from interface:KrmsTypeDefinitionContractReturns 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:
getNamein interfaceKrmsTypeDefinitionContract- Returns:
- the name of this KrmsTypeDefinition
-
getNamespace
Description copied from interface:KrmsTypeDefinitionContractReturns 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:
getNamespacein interfaceKrmsTypeDefinitionContract- Returns:
- the namespace of this KrmsTypeDefinition
-
getServiceName
Description copied from interface:KrmsTypeDefinitionContractReturns the name of the service used to resolve attribute values. The service name may be null or blank.- Specified by:
getServiceNamein interfaceKrmsTypeDefinitionContract- Returns:
- the service name of this KrmsTypeDefinition
-
getAttributes
Description copied from interface:KrmsTypeDefinitionContractReturns 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:
getAttributesin interfaceKrmsTypeDefinitionContract- Returns:
- the list of KrmsTypeAttributeContract attribute definition contracts
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceInactivatable
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
build
Builds an instance of a KrmsTypeDefinition based on the current state of the builder.- Specified by:
buildin interfaceModelBuilder- Returns:
- the fully-constructed KrmsTypeDefinition
-