Closed YooYoungmo closed 7 years ago
CleanCode
public class AppConfig { ... ... public static Map<String, String> get(String id) throws IOException { ... ... String appEnvProfileActive = System.getProperty(SYSTEM_PROPERTY_APP_ENV_PROFILE_ACTIVE); Map<String, String> targetMap = configMap.get(CONFIG_PROFILE_ELEMENT).get(appEnvProfileActive).get(id); Map<String, String> resultMap = new HashMap<String, String>(); Set<Map.Entry<String, String>> set = targetMap.entrySet(); for(Map.Entry<String, String> o : set) { resultMap.put(o.getKey(), o.getValue()); } return resultMap; } }
CleanCode