throw new StuffNotFoundException("Group definition with id " + definitionId);
}
}
private GroupDefinitionRest buildGDRestFromDefinition(GroupDefinition def) {
GroupDefinitionRest gdr = new GroupDefinitionRest(def.getId(),def.getName(),def.getDescription(), def.getRecalculationInterval());
gdr.setRecursive(def.isRecursive());
List<Integer> generatedGroups;
if (def.getManagedResourceGroups()!=null) {
generatedGroups = new ArrayList<Integer>(def.getManagedResourceGroups().size());
for (ResourceGroup group : def.getManagedResourceGroups() ) {
generatedGroups.add(group.getId());
}
} else {
generatedGroups = Collections.emptyList();
}
gdr.setGeneratedGroupIds(generatedGroups);
gdr.setExpression(def.getExpressionAsList());
return gdr;
}