use of com.thinkbiganalytics.nifi.rest.model.NifiPropertyGroup in project kylo by Teradata.
the class NifiPropertyUtil method groupPropertiesByProcessGroupAndProcessor.
/**
* Return a map of processGroupId to a map of that groups processors and its respective propeties
*
* @param properties the properties to inspect
* @return a map with the key being the processGroupId and the value being a map of properties with its key being the processorId
*/
public static Map<String, Map<String, NifiPropertyGroup>> groupPropertiesByProcessGroupAndProcessor(List<NifiProperty> properties) {
Map<String, Map<String, NifiPropertyGroup>> processGroupProperties = new HashMap();
for (NifiProperty property : properties) {
String processGroup = property.getProcessGroupId();
String processorId = property.getProcessorId();
if (!processGroupProperties.containsKey(processGroup)) {
processGroupProperties.put(processGroup, new HashMap<String, NifiPropertyGroup>());
}
if (!processGroupProperties.get(processGroup).containsKey(processorId)) {
processGroupProperties.get(processGroup).put(processorId, new NifiPropertyGroup(processorId));
}
processGroupProperties.get(processGroup).get(processorId).add(property);
}
return processGroupProperties;
}
Aggregations