@Override public List<ILifecycleComponent> findComponentsOfType(LifecycleComponentType type) throws SiteWhereException { List<ILifecycleComponent> matches = new ArrayList<ILifecycleComponent>(); findComponentsOfType(this, matches, type); return matches; }
@Override public List<ILifecycleComponent> findComponentsOfType(LifecycleComponentType type) throws SiteWhereException { List<ILifecycleComponent> matches = new ArrayList<ILifecycleComponent>(); findComponentsOfType(this, matches, type); return matches; }
/** * Recursive matching of nested components to find those of the given type. * * @param current * @param matches * @param type * @throws SiteWhereException */ public void findComponentsOfType(ILifecycleComponent current, List<ILifecycleComponent> matches, LifecycleComponentType type) throws SiteWhereException { if (current.getComponentType() == type) { matches.add(current); } for (ILifecycleComponent child : current.getLifecycleComponents().values()) { findComponentsOfType(child, matches, type); } }
/** * Recursive matching of nested components to find those of the given type. * * @param current * @param matches * @param type * @throws SiteWhereException */ public void findComponentsOfType(ILifecycleComponent current, List<ILifecycleComponent> matches, LifecycleComponentType type) throws SiteWhereException { if (current.getComponentType() == type) { matches.add(current); } for (ILifecycleComponent child : current.getLifecycleComponents().values()) { findComponentsOfType(child, matches, type); } }