Class PropositionDefinition.Builder
java.lang.Object
org.kuali.rice.krms.api.repository.proposition.PropositionDefinition.Builder
- All Implemented Interfaces:
Serializable,Identifiable,Versioned,ModelBuilder,PropositionDefinitionContract
- Enclosing class:
- PropositionDefinition
public static class PropositionDefinition.Builder
extends Object
implements PropositionDefinitionContract, ModelBuilder, Serializable
This builder is used to construct instances of KRMS Proposition. It enforces the constraints of the
PropositionDefinitionContract.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of a Proposition based on the current state of the builder.compoundComponents(List<PropositionDefinition.Builder> components) Set the value of the components to the given value.compoundOpCode(String opCode) Set the value of the opCode to the given value.create(String propId, String propTypeCode, String ruleId, String typeId, List<PropositionParameter.Builder> parameters) Create a Builder with the given valuescreate(PropositionDefinitionContract contract) Creates a builder by populating it with data from the givenPropositionDefinitionContract.Returns the propositions which are contained in a compound proposition.Returns the op code to be used when evaluating compound propositions.Returns the sequence number used to order the compound propositions Note: this value is set by the serviceReturns the description text for the KRMS propositiongetId()Returns the parameter list of the proposition.There are three main types of Propositions: Compound Propositions - a proposition consisting of other propositions and a boolean algebra operator (AND, OR) defining how to evaluate those propositions.TReturns the ID of the rule this proposition belongs to.Returns the id of Proposition KrmsType of the proposition.voidsetCompoundComponents(List<PropositionDefinition.Builder> components) Sets the value of the components on this builder to the given value.voidsetCompoundOpCode(String opCode) Sets the value of the opCode on this builder to the given value.voidsetCompoundSequenceNumber(Integer seqNo) Sets the value of the compound sequence no on this builder to the given value.voidsetDescription(String description) Sets the value of the description on this builder to the given value.voidSets the value of the propId on this builder to the given value.voidsetParameters(List<PropositionParameter.Builder> parameters) Sets the value of the parameters on this builder to the given value.voidsetPropositionTypeCode(String propTypeCode) Sets the value of the propTypeCode on this builder to the given value.voidSets the value of the rule on this builder to the given value.voidSets the value of the ruleId on this builder to the given value.voidSets the value of the typeId on this builder to the given value.voidsetVersionNumber(Long versionNumber) Sets the value of the versionNumber on this builder to the given value.
-
Method Details
-
compoundOpCode
Set the value of the opCode to the given value.- Parameters:
opCode- the opCode value to set- Returns:
- Builder an instance of the builder populated with given parameters
-
compoundComponents
public PropositionDefinition.Builder compoundComponents(List<PropositionDefinition.Builder> components) Set the value of the components to the given value.- Parameters:
components- the components value to set- Returns:
- Builder
-
create
public static PropositionDefinition.Builder create(String propId, String propTypeCode, String ruleId, String typeId, List<PropositionParameter.Builder> parameters) Create a Builder with the given values- Parameters:
propId- the propId value to setpropTypeCode- the propTypeCode value to setruleId- the ruleId value to settypeId- the typeId value to setparameters- the parameters value to set- Returns:
- Builder an instance of the builder populated with given parameters
-
create
Creates a builder by populating it with data from the givenPropositionDefinitionContract.- Parameters:
contract- the contract from which to populate this builder- Returns:
- an instance of the builder populated with data from the contract
-
setId
Sets the value of the propId on this builder to the given value.- Parameters:
propId- the propId value to set- Throws:
IllegalArgumentException- if the propId is null or blank
-
setDescription
Sets the value of the description on this builder to the given value.- Parameters:
description- the description value to set
-
setTypeId
Sets the value of the typeId on this builder to the given value.- Parameters:
typeId- the typeId value to set
-
setRuleId
Sets the value of the ruleId on this builder to the given value.- Parameters:
ruleId- the ruleId value to set
-
setRule
Sets the value of the rule on this builder to the given value.- Parameters:
rule- the rule value to set
-
setPropositionTypeCode
Sets the value of the propTypeCode on this builder to the given value.- Parameters:
propTypeCode- the propTypeCode value to set- Throws:
IllegalArgumentException- if the propTypeCode is null, blank or invalid
-
setParameters
Sets the value of the parameters on this builder to the given value.- Parameters:
parameters- the parameters value to set
-
setCompoundOpCode
Sets the value of the opCode on this builder to the given value.- Parameters:
opCode- the opCode value to set- Throws:
IllegalArgumentException- if the opCode invalid
-
setCompoundSequenceNumber
Sets the value of the compound sequence no on this builder to the given value.- Parameters:
seqNo- the sequence number for this compound prop- Throws:
IllegalArgumentException- if the seqNo invalid
-
setCompoundComponents
Sets the value of the components on this builder to the given value.- Parameters:
components- the components value to set
-
setVersionNumber
Sets the value of the versionNumber on this builder to the given value.- Parameters:
versionNumber- the versionNumber value to set
-
getId
- Specified by:
getIdin interfaceIdentifiable
-
getDescription
Description copied from interface:PropositionDefinitionContractReturns the description text for the KRMS proposition- Specified by:
getDescriptionin interfacePropositionDefinitionContract- Returns:
- description for KRMS type.
-
getRuleId
Description copied from interface:PropositionDefinitionContractTReturns the ID of the rule this proposition belongs to. May be null if this proposition has not yet been persisted.- Specified by:
getRuleIdin interfacePropositionDefinitionContract- Returns:
- the ID of the Rule this proposition belongs to.
-
getTypeId
Description copied from interface:PropositionDefinitionContractReturns the id of Proposition KrmsType of the proposition. It provides some context to what type of object of the KRMS type.- Specified by:
getTypeIdin interfacePropositionDefinitionContract- Returns:
- the id of the KRMS type.
-
getPropositionTypeCode
Description copied from interface:PropositionDefinitionContractThere are three main types of Propositions: Compound Propositions - a proposition consisting of other propositions and a boolean algebra operator (AND, OR) defining how to evaluate those propositions. Parameterized Propositions - a proposition which is parameterized by some set of values, evaluation logic is implemented by hand and returns true or false Simple Propositions - a proposition of the form lhs op rhs where lhs=left-hand side, rhs=right-hand side, and op=operator
- Specified by:
getPropositionTypeCodein interfacePropositionDefinitionContract- Returns:
- the proposition type code of the proposition
Valid values are C = compound, P = parameterized, S = simple
-
getParameters
Description copied from interface:PropositionDefinitionContractReturns the parameter list of the proposition. Parameters are listed in Reverse Polish Notation. Parameters may be constants, terms, or functions.Compound Propositions will have an empty parameter list.
- Specified by:
getParametersin interfacePropositionDefinitionContract- Returns:
- the Parameters related to the proposition
- See Also:
-
getCompoundOpCode
Description copied from interface:PropositionDefinitionContractReturns the op code to be used when evaluating compound propositions.- Specified by:
getCompoundOpCodein interfacePropositionDefinitionContract- Returns:
- the compound op code. valid values are A = and, O = or
-
getCompoundSequenceNumber
Description copied from interface:PropositionDefinitionContractReturns the sequence number used to order the compound propositions Note: this value is set by the service- Specified by:
getCompoundSequenceNumberin interfacePropositionDefinitionContract- Returns:
- the compound sequence number
-
getCompoundComponents
Description copied from interface:PropositionDefinitionContractReturns the propositions which are contained in a compound proposition.- Specified by:
getCompoundComponentsin interfacePropositionDefinitionContract- Returns:
- an ordered list of the Propositions which make up the compound proposition.
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
build
Builds an instance of a Proposition based on the current state of the builder.- Specified by:
buildin interfaceModelBuilder- Returns:
- the fully-constructed Proposition
-