diff options
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/ServiceId.java')
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/ServiceId.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/ServiceId.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/ServiceId.java new file mode 100644 index 00000000000..b61ead75b72 --- /dev/null +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/ServiceId.java @@ -0,0 +1,39 @@ +/* +* Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + */ + +package ai.vespa.metricsproxy.metric.model; + +import java.util.Objects; + +/** + * @author gjoranv + */ +public class ServiceId { + + public final String id; + private ServiceId(String id) { this.id = id; } + + public static ServiceId toServiceId(String id) { return new ServiceId(id); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ServiceId serviceId = (ServiceId) o; + return Objects.equals(id, serviceId.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + return "ServiceId{" + + "id='" + id + '\'' + + '}'; + } + +} |