Class TreeFlattener
java.lang.Object
org.pgcodekeeper.core.model.difftree.TreeFlattener
Utility class for flattening tree structures with filtering capabilities.
Provides methods to filter tree elements based on selection status, edit state,
ignore lists, and object types while maintaining proper hierarchy traversal.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionflatten(TreeElement root) Flattens the tree structure applying all configured filters.Configures the flattener to include only edited elements.Configures the flattener to include only selected elements.onlySelected(boolean onlySelected) Configures whether to include only selected elements.onlyTypes(Collection<DbObjType> onlyTypes) Configures the flattener to include only specific object types.useIgnoreList(IgnoreList ignoreList) Configures the flattener to use an ignore list for filtering.useIgnoreList(IgnoreList ignoreList, String... dbNames) Configures the flattener to use an ignore list with database name filtering.
-
Constructor Details
-
TreeFlattener
public TreeFlattener()
-
-
Method Details
-
onlySelected
Configures the flattener to include only selected elements.- Returns:
- this TreeFlattener for method chaining
-
onlySelected
Configures whether to include only selected elements.- Parameters:
onlySelected- true to include only selected elements- Returns:
- this TreeFlattener for method chaining
-
onlyEdits
Configures the flattener to include only edited elements.- Parameters:
dbSource- source database for comparisondbTarget- target database for comparison- Returns:
- this TreeFlattener for method chaining
-
useIgnoreList
Configures the flattener to use an ignore list for filtering.- Parameters:
ignoreList- the ignore list to apply- Returns:
- this TreeFlattener for method chaining
-
useIgnoreList
Configures the flattener to use an ignore list with database name filtering.- Parameters:
ignoreList- the ignore list to applydbNames- database names for rule matching- Returns:
- this TreeFlattener for method chaining
-
onlyTypes
Configures the flattener to include only specific object types.- Parameters:
onlyTypes- collection of object types to include- Returns:
- this TreeFlattener for method chaining
-
flatten
Flattens the tree structure applying all configured filters.- Parameters:
root- the root element to start flattening from- Returns:
- list of filtered tree elements
-