Class MultiselectDecisionTree
java.lang.Object
de.westemeyer.plugins.multiselect.MultiselectDecisionTree
- All Implemented Interfaces:
Serializable
Tree object accumulating all meta information entered in configuration of the build parameter
configuration form.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInitialValuesForColumn(int column) Get initial values for column when first displaying list of select boxes in "build with parameters" view.getItemByCoordinates(Integer... coordinates) Convenience method to get item by its position in tree, by stepping along the tree branches using indices.Get item list of first column.Get meta information about build variables/columns.Get list of variable labels from list of variable descriptors.Get list of variable names from list of variable descriptors.static MultiselectDecisionTreeConvenience method for parameterized unit tests.resolveValues(Map<String, Integer> selectedValues) Create key value pairs of variable name and its value from its name and its selected column index.voidserialize(ConfigSerialization serialization, OutputStream outputStream) Serialize the tree using a given serialization method.voidsetItemList(List<MultiselectDecisionItem> itemList) Set item list of first column.voidsetVariableDescriptions(List<MultiselectVariableDescriptor> variableDescriptions) Set meta information about build variables/columns.toString()voidSet up initial values for display in drop down boxes on web page.voidvisitSelectedItems(Queue<Integer> itemPath, MultiselectDecisionItemVisitor visitor) Use a visitor object/lambda to perform an action on one item per column.voidUse a visitor object/lambda to iterate all items in tree.
-
Constructor Details
-
MultiselectDecisionTree
@DataBoundConstructor public MultiselectDecisionTree()Empty constructor for pipeline configuration.
-
-
Method Details
-
getInitialValuesForColumn
Get initial values for column when first displaying list of select boxes in "build with parameters" view.- Parameters:
column- column number- Returns:
- list of items to display in given column
-
getItemByCoordinates
Convenience method to get item by its position in tree, by stepping along the tree branches using indices.- Parameters:
coordinates- list of indices- Returns:
- item from tree
-
serialize
public void serialize(ConfigSerialization serialization, OutputStream outputStream) throws Exception Serialize the tree using a given serialization method.- Parameters:
serialization- serialization method to useoutputStream- output stream to write to- Throws:
Exception- in case an error occurs writing to output stream
-
visitSubTree
Use a visitor object/lambda to iterate all items in tree.- Parameters:
visitor- lambda to execute for each item in tree- Throws:
Exception- in case an error occurs in lambda
-
visitSelectedItems
Use a visitor object/lambda to perform an action on one item per column.- Parameters:
itemPath- the item indices to select from each columnvisitor- lambda to execute for select items in tree
-
parse
Convenience method for parameterized unit tests.- Parameters:
csvInput- csv input- Returns:
- new parsed instance
-
resolveValues
Create key value pairs of variable name and its value from its name and its selected column index. For example: COLUMN1=3 resolves to COLUMN1=ValueInRow3.- Parameters:
selectedValues- map of variable names and column indices (row numbers)- Returns:
- property list of table cell values with variable name as key
-
getItemList
Get item list of first column.- Returns:
- item list of first column
-
setItemList
Set item list of first column.- Parameters:
itemList- item list of first column
-
getVariableDescriptions
Get meta information about build variables/columns.- Returns:
- meta information about build variables/columns.
-
getVariableLabels
Get list of variable labels from list of variable descriptors.- Returns:
- list of variable labels
-
getVariableNames
Get list of variable names from list of variable descriptors.- Returns:
- list of variable names
-
setVariableDescriptions
@DataBoundSetter public void setVariableDescriptions(@NonNull List<MultiselectVariableDescriptor> variableDescriptions) Set meta information about build variables/columns.- Parameters:
variableDescriptions- meta information about build variables/columns
-
updateInitialValues
public void updateInitialValues()Set up initial values for display in drop down boxes on web page. -
toString
-