package schedframe.resources.units; public class ResourceUnitNameFactory { public static ResourceUnitName createResourceUnitName(String unitName){ if(unitName.equals(StandardResourceUnitName.MEMORY.getLabel())) return StandardResourceUnitName.MEMORY; else if (unitName.equals(StandardResourceUnitName.STORAGE.getLabel())) return StandardResourceUnitName.STORAGE; else if (unitName.equals(StandardResourceUnitName.PE.getLabel())) return StandardResourceUnitName.PE; else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getLabel())) return StandardResourceUnitName.CPUSPEED; else if (unitName.equals(StandardResourceUnitName.GPU.getLabel())) return StandardResourceUnitName.GPU; else if (unitName.equals(StandardResourceUnitName.APPLICATION.getLabel())) return StandardResourceUnitName.APPLICATION; else if (unitName.equals(StandardResourceUnitName.COST.getLabel())) return StandardResourceUnitName.COST; else return new CustomResourceUnitName(unitName); } }