/** * Build a component map by recursively navigating the component tree. * * @return */ protected Map<String, ILifecycleComponent> buildComponentMap() { Map<String, ILifecycleComponent> map = new HashMap<String, ILifecycleComponent>(); buildComponentMap(this, map); return map; }
/** * Build a component map by recursively navigating the component tree. * * @return */ protected Map<UUID, ILifecycleComponent> buildComponentMap() { Map<UUID, ILifecycleComponent> map = new HashMap<>(); buildComponentMap(this, map); return map; }
/** * Recursively navigates component structure and creates a map of components * by id. * * @param current * @param map */ protected static void buildComponentMap(ILifecycleComponent current, Map<String, ILifecycleComponent> map) { map.put(current.getComponentId(), current); for (ILifecycleComponent sub : current.getLifecycleComponents().values()) { // Root components have a separate hierarchy. if (!(sub instanceof ILifecycleHierarchyRoot)) { buildComponentMap(sub, map); } } }
/** * Recursively navigates component structure and creates a map of components by * id. * * @param current * @param map */ protected static void buildComponentMap(ILifecycleComponent current, Map<UUID, ILifecycleComponent> map) { map.put(current.getComponentId(), current); for (ILifecycleComponent sub : current.getLifecycleComponents().values()) { // Root components have a separate hierarchy. if (!(sub instanceof ILifecycleHierarchyRoot)) { buildComponentMap(sub, map); } } }