Code example for ConcurrentHashMap

Methods: get

0
    public Map<String, String> getSettings() {
        return settings;
    } 
 
    public String getSetting(String field) {
        return settings.get(field);
    } 
 
    public void addSetting(String field, String value) {
        String s = settings.get(field);
        if (s == null) {
            settings.putIfAbsent(field, value);
        } 
        else { 
            logger.error(String.format("Duplicate settings for '%s'", field));
        } 
    } 
 
}