public static final class FunctionDefinition.Builder extends Object implements FunctionDefinitionContract, ModelBuilder, Serializable
FunctionDefinition
instances. Enforces the constraints of the FunctionDefinitionContract
.Modifier and Type | Method and Description |
---|---|
FunctionDefinition |
build()
Returns an instance of the object being built by this builder based
on the current state of the builder.
|
static FunctionDefinition.Builder |
create(FunctionDefinitionContract contract)
Creates and populates a builder with the data on the given
FunctionDefinitionContract . |
static FunctionDefinition.Builder |
create(String namespace,
String name,
String returnType,
String typeId)
Creates a function definition builder with the given required values.
|
List<CategoryDefinition.Builder> |
getCategories()
Returns an ordered list of the categories which this function
definition requires.
|
String |
getDescription()
Returns the description of this function definition.
|
String |
getId()
The unique identifier for an object.
|
String |
getName()
Returns the name of this function definition.
|
String |
getNamespace()
Returns the namespace code of this function definition.
|
List<FunctionParameterDefinition.Builder> |
getParameters()
Returns an ordered, immutable list of the parameters which this function
definition requires.
|
String |
getReturnType()
Returns the type of the return value of the function defined by this
function definition.
|
String |
getTypeId()
Returns the id of the
KrmsTypeDefinition which defines the
actual implementation of this function such that it can be loaded into
the engine and executed. |
Long |
getVersionNumber()
Returns the version number for this object.
|
boolean |
isActive()
The active indicator for an object.
|
void |
setActive(boolean active)
Sets the active flag for the function definition that will be
returned by this builder.
|
void |
setCategories(List<CategoryDefinition.Builder> categories)
Sets the category for the function definition that will be returned by this builder.
|
void |
setDescription(String description)
Sets the description for the function definition that will be returned by this builder.
|
void |
setId(String id)
Sets the id for the function definition that will be returned by this builder.
|
void |
setName(String name)
Sets the name for the function definition that will be returned by this builder.
|
void |
setNamespace(String namespace)
Sets the namespace code for the function definition that will be returned by this builder.
|
void |
setParameters(List<FunctionParameterDefinition.Builder> parameters)
Sets the parameters for the function definition that will be returned by this builder.
|
void |
setReturnType(String returnType)
Sets the return type for the function definition that will be
returned by this builder.
|
void |
setTypeId(String typeId)
Sets the id of the
KrmsTypeDefinition which defines the
actual implementation of this function. |
void |
setVersionNumber(Long versionNumber)
Sets the version number for the function definition that will be
returned by this builder.
|
public static FunctionDefinition.Builder create(String namespace, String name, String returnType, String typeId)
FunctionDefinition
object should be created.
Will default the active flag to true.
namespace
- the namespace of the function definition to create, must not be null or blankname
- the name of the function definition to create, must not be null or blankreturnType
- the return type of the function definition to create, must not be null or blanktypeId
- the return type id of the function definition to create, must not be null or blankIllegalArgumentException
- if any of the given arguments is null or blankpublic static FunctionDefinition.Builder create(FunctionDefinitionContract contract)
FunctionDefinitionContract
.
This is similar in nature to a "copy constructor" for FunctionDefinition
.contract
- an object implementing the FunctionDefinitionContract
from which
to copy property valuesIllegalArgumentException
- if the given contract is nullpublic FunctionDefinition build()
ModelBuilder
build
in interface ModelBuilder
public String getId()
Identifiable
getId
in interface Identifiable
public void setId(String id)
id
- the function definition id to setpublic String getNamespace()
FunctionDefinitionContract
getNamespace
in interface FunctionDefinitionContract
public void setNamespace(String namespace)
namespace
- the namespace code to set on this builder, must not be null or blankIllegalArgumentException
- if the given namespace is null or blankpublic String getName()
FunctionDefinitionContract
getName
in interface FunctionDefinitionContract
public void setName(String name)
name
- the name to set on this builder, must not be null or blankIllegalArgumentException
- if the given name is null or blankpublic String getDescription()
FunctionDefinitionContract
getDescription
in interface FunctionDefinitionContract
public void setDescription(String description)
description
- the description to set on this builderpublic String getReturnType()
FunctionDefinitionContract
getReturnType
in interface FunctionDefinitionContract
public void setReturnType(String returnType)
returnType
- the returnType to set on this builder, must not be null or blankIllegalArgumentException
- if the given returnType is null or blankpublic String getTypeId()
FunctionDefinitionContract
KrmsTypeDefinition
which defines the
actual implementation of this function such that it can be loaded into
the engine and executed.getTypeId
in interface FunctionDefinitionContract
public void setTypeId(String typeId)
KrmsTypeDefinition
which defines the
actual implementation of this function. The typeId must not be
null or blank.typeId
- the typeId to set on this builder, must not be null or blankIllegalArgumentException
- if the given typeId is null or blankpublic boolean isActive()
Inactivatable
isActive
in interface Inactivatable
public void setActive(boolean active)
active
- the active flag to setpublic Long getVersionNumber()
Versioned
getVersionNumber
in interface Versioned
public void setVersionNumber(Long versionNumber)
In general, this value should not be manually set on the builder,
but rather copied from an existing FunctionDefinitionContract
when
invoking create(FunctionDefinitionContract)
.
versionNumber
- the version number to setpublic List<FunctionParameterDefinition.Builder> getParameters()
FunctionDefinitionContract
getParameters
in interface FunctionDefinitionContract
public void setParameters(List<FunctionParameterDefinition.Builder> parameters)
FunctionParameterDefinition
instances that will form the parameters of this function definition. The given list
must not be null.parameters
- a list of builders for the parameters which will be specified on this function definitionIllegalArgumentException
- if the given parameters list is nullpublic List<CategoryDefinition.Builder> getCategories()
FunctionDefinitionContract
getCategories
in interface FunctionDefinitionContract
public void setCategories(List<CategoryDefinition.Builder> categories)
CategoryDefinition
instances that will form the categories of this function definition. The given list
must not be null.categories
- a list of builders for the categories which will be specified on this function definitionIllegalArgumentException
- if the given categories list is nullCopyright © 2005–2015 The Kuali Foundation. All rights reserved.