Sort static factory methods at bottom

This commit is contained in:
Chris Beams 2018-02-20 13:32:30 +01:00
parent fb856aea95
commit 08ca7ee0f9
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73

View File

@ -28,17 +28,6 @@ import java.util.stream.Collector;
import java.util.stream.Collectors;
class SeedNodeAddresses extends ImmutableSetDecorator<NodeAddress> {
public static SeedNodeAddresses fromString(String seedNodes) {
if (seedNodes.isEmpty()) {
return new SeedNodeAddresses(Collections.emptySet());
}
String trimmed = StringUtils.deleteWhitespace(seedNodes);
String[] nodes = trimmed.split(",");
return Arrays.stream(nodes)
.map(NodeAddress::new)
.collect(collector());
}
public SeedNodeAddresses(Set<NodeAddress> delegate) {
super(delegate);
@ -62,4 +51,16 @@ class SeedNodeAddresses extends ImmutableSetDecorator<NodeAddress> {
public static Collector<NodeAddress, ?, SeedNodeAddresses> collector() {
return Collectors.collectingAndThen(Collectors.toSet(), SeedNodeAddresses::new);
}
public static SeedNodeAddresses fromString(String seedNodes) {
if (seedNodes.isEmpty()) {
return new SeedNodeAddresses(Collections.emptySet());
}
String trimmed = StringUtils.deleteWhitespace(seedNodes);
String[] nodes = trimmed.split(",");
return Arrays.stream(nodes)
.map(NodeAddress::new)
.collect(collector());
}
}