#653 - Use Java 8 Stream API.
This commit is contained in:
committed by
Oliver Gierke
parent
7a5b7b1c9f
commit
4c7227e274
@@ -19,7 +19,6 @@ import lombok.Getter;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -99,11 +98,9 @@ public class DefaultCurieProvider implements CurieProvider {
|
||||
@Override
|
||||
public Collection<? extends Object> getCurieInformation(Links links) {
|
||||
|
||||
List<Curie> result = curies.entrySet().stream() //
|
||||
return curies.entrySet().stream() //
|
||||
.map(it -> new Curie(it.getKey(), getCurieHref(it.getKey(), it.getValue()))) //
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return Collections.unmodifiableCollection(result);
|
||||
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableCollection));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -914,13 +914,8 @@ public class Jackson2HalModule extends SimpleModule {
|
||||
*/
|
||||
public boolean hasCuriedEmbed(Iterable<?> source) {
|
||||
|
||||
for (String rel : map(source).keySet()) {
|
||||
if (rel.contains(":")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return map(source).keySet().stream()
|
||||
.anyMatch(rel -> rel.contains(":"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user