public abstract class CalculableLineItemCollectionBuilder<T extends CalculableLineItemCollectionBuilder>
extends AbstractBuilder
Modifier and Type | Field and Description |
---|---|
static String |
METHOD_ADD_LINE_ITEM |
static String |
METHOD_ADD_OR_UPDATE_INPUT |
static String |
METHOD_ADD_OR_UPDATE_OUTPUT |
static String |
METHOD_UPDATE_FIELD |
protected HeaderPhase |
phase |
static String |
ROOT_LINE_ID |
Constructor and Description |
---|
CalculableLineItemCollectionBuilder(String instanceId,
String classId,
ObjectIdentity parentChartObjectIdentity,
IdGenerator idGenerator,
Invocations<MethodInvocation> invocations,
HeaderPhase phase) |
Modifier and Type | Method and Description |
---|---|
T |
addLineItem(String key)
This method adds a new line item in the root folder
|
T |
addLineItem(String parentLineId,
String key)
This method adds a new line item in the specified parent (folder id)
|
T |
addLineItem(String parentLineId,
String key,
List<Map<String,Object>> contextParameter)
This method adds a new line item in the specified parent (folder id) and sets some context parameters
|
T |
addOrUpdateInput(Map<String,Object> contextParameter)
This method adds or updates an input value on the root level
|
T |
addOrUpdateInput(String lineId,
Map<String,Object> contextParameter)
This method adds or updates an input value on a line item
|
T |
addOrUpdateOutput(Map<String,Object> calculationResult)
This method adds or updates a result value (an output value) on the root level
|
T |
addOrUpdateOutput(String lineId,
Map<String,Object> calculationResult)
This method adds or updates a result value (an output value) on a line item
|
T |
deleteItem(String lineId)
Deletes an item or folder.
|
boolean |
isPostPhase()
Determines current calculation phase of logic execution
|
boolean |
isPrePhase()
Determines current calculation phase of logic execution
|
T |
moveItem(String lineId,
String newParentId)
Moves an item or folder underneath a new parent.
|
T |
renameFolder(String lineId,
String newFolderLabel)
Renames a folder (not items!)
|
T |
updateField(String fieldName,
Object value)
Updates a header field
For quotes supported fields are:
additionalInfo1
additionalInfo2
additionalInfo3
additionalInfo4
externalRef
expiryDate
editabilityStatus
targetDate |
T |
updateField(String lineId,
String fieldName,
Object value)
Updates a field on the line.
|
protected final HeaderPhase phase
public static final String METHOD_ADD_OR_UPDATE_OUTPUT
public static final String METHOD_ADD_OR_UPDATE_INPUT
public static final String METHOD_UPDATE_FIELD
public static final String METHOD_ADD_LINE_ITEM
public static final String ROOT_LINE_ID
public boolean isPrePhase()
public boolean isPostPhase()
public T addOrUpdateOutput(Map<String,Object> calculationResult)
calculationResult
- A map describing a calculation resultpublic T addOrUpdateOutput(String lineId, Map<String,Object> calculationResult)
lineId
- The id of the linecalculationResult
- A map describing a calculation resultpublic T addOrUpdateInput(Map<String,Object> contextParameter)
contextParameter
- A map describing the context parameterpublic T addOrUpdateInput(String lineId, Map<String,Object> contextParameter)
lineId
- The id of the linecontextParameter
- A map describing the context parameterpublic T updateField(String lineId, String fieldName, Object value)
lineId
- The id of the linefieldName
- The field namevalue
- The new valuepublic T updateField(String fieldName, Object value)
additionalInfo1
additionalInfo2
additionalInfo3
additionalInfo4
externalRef
expiryDate
editabilityStatus
targetDate
fieldName
- The field namevalue
- The new valuepublic T addLineItem(String key)
key
- The key (usually the sku)public T addLineItem(String parentLineId, String key)
parentLineId
- id of parent itemkey
- The key (usually the sku)public T addLineItem(String parentLineId, String key, List<Map<String,Object>> contextParameter)
parentLineId
- id of parent itemkey
- The key (usually the sku)contextParameter
- A list of maps describing the context parameterspublic T moveItem(String lineId, String newParentId)
lineId
- The line ID of the item to movenewParentId
- The line ID of the target folder. null if you want to move it to root folderpublic T renameFolder(String lineId, String newFolderLabel)
lineId
- The line ID of the folder to renamenewFolderLabel
- New labelCopyright © 2017. All rights reserved.