Interface LineItemHelper.LineItem
- Enclosing interface:
LineItemHelper
public static interface LineItemHelper.LineItem
Represents a line item, a folder, or the document root of a CLIC document (a Quote, Contract, Rebate
Agreement, Sales Compensation, or Custom Form), obtained from
LineItemHelper.getRoot(),
LineItemHelper.findByLineId(String), LineItemHelper.findAllWithLabel(String), or
getChildren()/getParent()/getSiblings()/getSubLineItems() rather
than instantiated directly.-
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns this line item's raw map representation.Provides list of all children of this folder.Returns the unique name of this line item's Contract Term Type, for a Contract line item.getInputByName(String inputName) Finds this line item's input parameter with the given name, searching its inputs and any nested inputs.Returns this line item's own input parameters, not including any nested inputs.getLabel()Returns this line item's or folder's display label, or, for the document root, the document's own label.Returns this line item's line ID.getOutputByName(String outputName) Finds this line item's output result with the given name.Returns this line item's output results.Returns this line item's parent folder, or the document root (seeLineItemHelper.getRoot()) if this line item is at the top level of the document.Returns the unique name of this line item's Rebate Type, for a Rebate Agreement line item.Gets the review status for this line item based on the current user's review context.Returns this line item's siblings: the other children of its parent, excluding itself.getSKU()Returns this line item's SKU.Returns all descendants of this folder: its children, their children, and so on, in breadth-first order.booleanisFolder()Reports whether this is a folder rather than a line item.booleanisRoot()Reports whether this is the document's root, as returned byLineItemHelper.getRoot(), rather than an actual line item or folder.
-
Method Details
-
asMap
Returns this line item's raw map representation.- Returns:
- this line item's raw map. Never
null.
-
isRoot
boolean isRoot()Reports whether this is the document's root, as returned byLineItemHelper.getRoot(), rather than an actual line item or folder.- Returns:
trueif this is the document root;falseotherwise
-
isFolder
boolean isFolder()Reports whether this is a folder rather than a line item. Alwaystruefor the document root.- Returns:
trueif this is a folder;falseotherwise
-
getLabel
String getLabel()Returns this line item's or folder's display label, or, for the document root, the document's own label.- Returns:
- this line item's label, or
nullif none is set
-
getLineId
String getLineId()Returns this line item's line ID.- Returns:
- this line item's line ID, or
nullfor the document root
-
getSKU
String getSKU()Returns this line item's SKU.- Returns:
- this line item's SKU, or
nullif not applicable, for example for a folder or the document root
-
getRebateTypeUN
String getRebateTypeUN()Returns the unique name of this line item's Rebate Type, for a Rebate Agreement line item.- Returns:
- the Rebate Type's unique name, or
nullif not applicable
-
getContractTermTypeUN
String getContractTermTypeUN()Returns the unique name of this line item's Contract Term Type, for a Contract line item.- Returns:
- the Contract Term Type's unique name, or
nullif not applicable
-
getChildren
List<LineItemHelper.LineItem> getChildren()Provides list of all children of this folder.- Returns:
- List of LineItem objects, or empty list, if no children.
-
getSiblings
List<LineItemHelper.LineItem> getSiblings()Returns this line item's siblings: the other children of its parent, excluding itself.- Returns:
- this line item's siblings. Never
null; empty if it has none.
-
getInputs
Returns this line item's own input parameters, not including any nested inputs.- Returns:
- this line item's inputs, or
nullif none are set - See Also:
-
getInputByName
Finds this line item's input parameter with the given name, searching its inputs and any nested inputs.- Parameters:
inputName- the technical name of the input to find- Returns:
- the matching input, or
nullifinputNameisnullor matches no input - See Also:
-
getOutputByName
Finds this line item's output result with the given name.- Parameters:
outputName- the result name to find- Returns:
- the matching output, or
nullifoutputNameisnull, this line item has no outputs, or none match - See Also:
-
getOutputs
Returns this line item's output results.- Returns:
- this line item's outputs, or
nullif none are set - See Also:
-
getParent
LineItemHelper.LineItem getParent()Returns this line item's parent folder, or the document root (seeLineItemHelper.getRoot()) if this line item is at the top level of the document.- Returns:
- this line item's parent, or
nullfor the document root (the Quote, Contract, Rebate Agreement, Sales Compensation, or Custom Form itself)
-
getSubLineItems
List<LineItemHelper.LineItem> getSubLineItems()Returns all descendants of this folder: its children, their children, and so on, in breadth-first order.- Returns:
- this folder's descendants. Never
null; empty if it has none.
-
getReviewStatus
String getReviewStatus()Gets the review status for this line item based on the current user's review context.The review status is determined by finding a review entry that matches:
- The current user's review user group (from ReviewContext)
- A lineItemGroupId that the current user is a member of (from ReviewContext)
- Is an active review (isInReview = true)
The status can be one of:
- UNREVIEWED - The line item has not been reviewed yet
- ACCEPTED - The line item has been accepted
- REJECTED - The line item has been rejected
- SKIPPED - The line item review was skipped
- Returns:
- The review status string, or
nullif no matching active review exists
-