use of org.kie.workbench.common.services.refactoring.model.query.RefactoringRuleNamePageRow in project kie-wb-common by kiegroup.
the class RuleNameResponseBuilder method buildResponse.
@Override
public List<RefactoringPageRow> buildResponse(final List<KObject> kObjects) {
// Both "child" rule and "parent" rule (when one extends another) are stored
// in the index. We therefore need to build a set of unique Rule Names
final List<RefactoringPageRow> result = new ArrayList<RefactoringPageRow>(kObjects.size());
final Set<RuleName> uniqueRuleNames = new HashSet<>();
for (final KObject kObject : kObjects) {
final Set<RuleName> ruleNames = getRuleNamesFromKObject(kObject);
uniqueRuleNames.addAll(ruleNames);
}
for (RuleName ruleName : uniqueRuleNames) {
final RefactoringRuleNamePageRow row = new RefactoringRuleNamePageRow();
row.setValue(ruleName);
result.add(row);
}
return result;
}
use of org.kie.workbench.common.services.refactoring.model.query.RefactoringRuleNamePageRow in project kie-wb-common by kiegroup.
the class RuleNameServiceImplTest method getResults.
private List<RefactoringPageRow> getResults() {
final List<RefactoringPageRow> results = new ArrayList<>();
results.add(new RefactoringRuleNamePageRow() {
{
setValue(new RuleName("rule1", "org.kie.test.package"));
}
});
results.add(new RefactoringRuleNamePageRow() {
{
setValue(new RuleName("rule2", "org.kie.test.package"));
}
});
return results;
}
Aggregations