prop.putAll(temp.entrySet().stream()
.filter( entry -> !prop.containsKey(entry.getKey()))
.map( new Function<Entry<Object, Object>, Entry<String, String>>(){
@Override
public Entry<String, String> apply(Entry<Object, Object> entry) {
return new Entry<String, String>() {
@Override
public String setValue(String value) {
return value.trim().toLowerCase();
}
@Override
public String getValue() {
return ((String) entry.getValue()).trim().toLowerCase();
}
@Override
public String getKey() {
return ((String) entry.getKey()).trim().toLowerCase();
}
};
}
})
.collect(Collectors.toMap(Entry::getKey, Entry::getValue)));
( )
prop.putAll(temp.entrySet().stream()
.filter( entry -> !prop.containsKey(entry.getKey()))
.map(entry -> new Entry<String, String>() {
@Override
public String setValue(String value) {
return value.trim().toLowerCase();
}
@Override
public String getValue() {
return ((String) entry.getValue()).trim().toLowerCase();
}
@Override
public String getKey() {
return ((String) entry.getKey()).trim().toLowerCase();
}
})
.collect(Collectors.toMap(Entry::getKey, Entry::getValue)));
, Function, Entry.
, Entry , setValue , . Entry, :
prop.putAll(temp.entrySet().stream()
.filter( entry -> !prop.containsKey(entry.getKey()))
.map(entry -> new AbstractMap.SimpleImmutableEntry<>(
((String) entry.getKey()).trim().toLowerCase(),
((String) entry.getValue()).trim().toLowerCase()))
.collect(Collectors.toMap(Entry::getKey, Entry::getValue)));
, Entry , toMap:
prop.putAll(temp.entrySet().stream()
.filter( entry -> !prop.containsKey(entry.getKey()))
.collect(Collectors.toMap(
entry -> ((String) entry.getKey()) .trim().toLowerCase(),
entry -> ((String) entry.getValue()).trim().toLowerCase())));