Interface LineItemHelper
- All Known Subinterfaces:
CompensationHelper,ContractHelper,QuoteHelper,QuotePersistedHelper,RebateAgreementHelper
public interface LineItemHelper
A helper interface that assists in navigating and reading a Calculable Line Item Collection (CLIC) document's
line items: a Quote, Contract, Rebate Agreement, Sales Compensation, or Custom Form. Obtained from the
document's builder via
getHelper() in header or line logic, for example
quoteProcessor.getHelper(), rather than instantiated directly.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a line item, a folder, or the document root of a CLIC document (a Quote, Contract, Rebate Agreement, Sales Compensation, or Custom Form), obtained fromgetRoot(),findByLineId(String),findAllWithLabel(String), orLineItemHelper.LineItem.getChildren()/LineItemHelper.LineItem.getParent()/LineItemHelper.LineItem.getSiblings()/LineItemHelper.LineItem.getSubLineItems()rather than instantiated directly.static final recordReview sub-step information. -
Method Summary
Modifier and TypeMethodDescriptionfindAllWithLabel(String label) Finds all line items, folders, and the root whose label matches the given label.findByLineId(String lineItemId) Finds the line item or folder with the given line ID.getFlattedInputs(List<Map<String, Object>> inputs) Flattens a list of input maps, including nested inputs, into a single flat list.getRoot()Returns the document's root, a syntheticLineItemHelper.LineItemrepresenting the document itself rather than any actual line item.lineItemFromMap(Map<String, Object> lineItemMap) Creates the line item object from the given map.
-
Method Details
-
getFlattedInputs
Flattens a list of input maps, including nested inputs, into a single flat list. Each input's own nested inputs (under its"inputs"key) are recursively included, depth-first, alongside the input itself.- Parameters:
inputs- the top-level inputs to flatten, ornull- Returns:
- the flattened list of inputs, including all nested inputs. Never
null; empty ifinputsisnull
-
lineItemFromMap
Creates the line item object from the given map. The structure of the map can be found, for example, in the result ofquoteProcessor.getQuoteView().- Parameters:
lineItemMap- the raw map representation of a single line item- Returns:
- a
LineItemHelper.LineItemwrapping the given map. Nevernull.
-
findByLineId
Finds the line item or folder with the given line ID.- Parameters:
lineItemId- the line ID to look up, or"ROOT"for the document's root- Returns:
- the matching
LineItemHelper.LineItem, ornulliflineItemIdisnullor matches no line item
-
getRoot
LineItemHelper.LineItem getRoot()Returns the document's root, a syntheticLineItemHelper.LineItemrepresenting the document itself rather than any actual line item.- Returns:
- the root
LineItemHelper.LineItem. Nevernull.
-
findAllWithLabel
Finds all line items, folders, and the root whose label matches the given label.- Parameters:
label- the label to match; must not benull- Returns:
- the matching
LineItemHelper.LineItems. Nevernull; empty if none match.
-