org.kuali.rice.krms.api.repository.proposition
Class PropositionParameter.Builder

java.lang.Object
  extended by org.kuali.rice.krms.api.repository.proposition.PropositionParameter.Builder
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelBuilder, PropositionParameterContract
Enclosing class:
PropositionParameter

public static class PropositionParameter.Builder
extends Object
implements PropositionParameterContract, ModelBuilder, Serializable

This builder is used to construct instances of PropositionParameter. It enforces the constraints of the PropositionParameterContract.

See Also:
Serialized Form

Method Summary
 PropositionParameter build()
          Builds an instance of a PropositionParameter based on the current state of the builder.
static PropositionParameter.Builder create(PropositionParameterContract contract)
          Creates a builder by populating it with data from the given PropositionParameterContract.
static PropositionParameter.Builder create(String id, String propId, String value, String parameterType, Integer sequenceNumber)
          Create a builder using the given values
 String getId()
          The unique identifier for an object.
 String getParameterType()
          Returns the type of the parameter.
 String getPropId()
          Returns the Id for the parent proposition.
 Integer getSequenceNumber()
          Returns the sequence number of the proposition parameter.
 String getValue()
          Returns the value of the proposition parameter
 Long getVersionNumber()
          Returns the version number for this object.
 void setId(String id)
          Sets the value of the id on this builder to the given value.
 void setParameterType(String parameterType)
          Sets the value of the parameterType on this builder to the given value.
 void setPropId(String propId)
          Sets the value of the propId on this builder to the given value.
 void setProposition(PropositionDefinition.Builder proposition)
          Sets the value of the proposition on this builder to the given value.
 void setSequenceNumber(Integer sequenceNumber)
          Sets the value of the sequenceNumber on this builder to the given value.
 void setValue(String value)
          Sets the value of the value on this builder to the given value.
 void setVersionNumber(Long versionNumber)
          Sets the value of the versionNumber on this builder to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static PropositionParameter.Builder create(String id,
                                                  String propId,
                                                  String value,
                                                  String parameterType,
                                                  Integer sequenceNumber)
Create a builder using the given values

Parameters:
id - the id value to set, must not be null or blank
propId - the propId value to set, must not be null or blank
value - the value value to set, must not be null or blank
parameterType - the value parameterType to set, must not be null or blank
sequenceNumber - the value sequenceNumber to set, must not be null or blank
Returns:
Builder with the given values set

create

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

Parameters:
contract - the contract from which to populate this builder
Returns:
an instance of the builder populated with data from the contract

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, must not be null or blank
Throws:
IllegalArgumentException - if the id is null or blank

setPropId

public void setPropId(String propId)
Sets the value of the propId on this builder to the given value.

Parameters:
propId - the propId value to set, must not be null or blank
Throws:
IllegalArgumentException - if the propId is null or blank

setValue

public void setValue(String value)
Sets the value of the value on this builder to the given value.

Parameters:
value - the value value to set, may be null, otherwise must contain non-whitespace
Throws:
IllegalArgumentException - if the value is all whitespace characters

setParameterType

public void setParameterType(String parameterType)
Sets the value of the parameterType on this builder to the given value.

Parameters:
parameterType - the value parameterType to set, must not be null or blank
Throws:
IllegalArgumentException - if the parameterType is null, blank, or invalid

setSequenceNumber

public void setSequenceNumber(Integer sequenceNumber)
Sets the value of the sequenceNumber on this builder to the given value.

Parameters:
sequenceNumber - the value sequenceNumber to set, must not be null or blank
Throws:
IllegalArgumentException - if the sequenceNumber is null, blank, or invalid

setProposition

public void setProposition(PropositionDefinition.Builder proposition)
Sets the value of the proposition on this builder to the given value.

Parameters:
proposition - the value proposition to set

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the value of the versionNumber on this builder to the given value.

Parameters:
versionNumber - the value versionNumber to set

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

getPropId

public String getPropId()
Description copied from interface: PropositionParameterContract
Returns the Id for the parent proposition.

It is the Id of the parent proposition.

Specified by:
getPropId in interface PropositionParameterContract
Returns:
Id for parent parameter.

getValue

public String getValue()
Description copied from interface: PropositionParameterContract
Returns the value of the proposition parameter

It is the value of the parameter

Specified by:
getValue in interface PropositionParameterContract
Returns:
value of the parameter

getParameterType

public String getParameterType()
Description copied from interface: PropositionParameterContract
Returns the type of the parameter. Proposition parameters are one of the following types: Constant Values: numbers, strings, dates, etc. Terms: data available in the execution environment or provided by a term resolver Functions: custom functions that resolve to a value, or standard operators (equals, greater than, less than, ...)

It identified the type of the parameter.

Specified by:
getParameterType in interface PropositionParameterContract
Returns:
the parameter type code. Valid values are C, T, and F.

getSequenceNumber

public Integer getSequenceNumber()
Description copied from interface: PropositionParameterContract
Returns the sequence number of the proposition parameter. Proposition parameters are listed in Reverse Polish Notation. The sequence number (starting with 1) identifies the position of the parameter in the list.

Specified by:
getSequenceNumber in interface PropositionParameterContract
Returns:
the sequence number of the proposition parameter

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 PropositionParameter build()
Builds an instance of a PropositionParameter based on the current state of the builder.

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


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