public boolean hasSoftwareUnit(String softwareUnitName) { boolean hasSoftwareUnit = false; for (SoftwareUnitDefinition unit : mappedSUunits) { if (unit.getName().equals(softwareUnitName)) { hasSoftwareUnit = true; } } for (Module mod : subModules) { if (mod.hasSoftwareUnit(softwareUnitName)) { hasSoftwareUnit = true; } } return hasSoftwareUnit; }
public SoftwareUnitDefinition getSoftwareUnitByName(String softwareUnitName) { SoftwareUnitDefinition softwareUnit = null; for (SoftwareUnitDefinition unit : mappedSUunits) { if (unit.getName().equals(softwareUnitName)) { softwareUnit = unit; } } for (Module mod : subModules) { if (mod.hasSoftwareUnit(softwareUnitName)) { softwareUnit = getSoftwareUnitByName(softwareUnitName); } } if (softwareUnit == null) { throw new RuntimeException("This Software Unit does not exist!"); } return softwareUnit; }