YooYoungmo / AEP

1 stars 1 forks source link

CleanCode의 '함수는 한 가지만 해야 한다' '코드로 의도를 표현하라!' 지키기 #2

Closed YooYoungmo closed 7 years ago

YooYoungmo commented 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;
    }
}
YooYoungmo commented 7 years ago

13 연관 이슈