summaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java
diff options
context:
space:
mode:
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java')
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java
index 821636336a8..21c7c78a224 100644
--- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java
+++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/Node.java
@@ -25,14 +25,10 @@ public class Node {
}
public Node(String role, String hostname, int port, String path) {
- Objects.requireNonNull(role, "Null role is not allowed");
- Objects.requireNonNull(hostname, "Null hostname is not allowed");
- Objects.requireNonNull(path, "Null path is not allowed");
-
- this.role = role;
- this.hostname = hostname;
+ this.role = Objects.requireNonNull(role, "Null role is not allowed");
+ this.hostname = Objects.requireNonNull(hostname, "Null hostname is not allowed");
this.port = port;
- this.path = path;
+ this.path = Objects.requireNonNull(path, "Null path is not allowed");
metricsUriBase = "http://" + hostname + ":" + port + path;
}
@@ -55,10 +51,10 @@ public class Node {
public int hashCode() {
return Objects.hash(role, hostname, port, path);
}
+
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(role).append(":").append(metricsUriBase);
- return sb.toString();
+ return role + ":" + metricsUriBase;
}
+
}