// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package ai.vespa.metricsproxy.metric; import ai.vespa.metricsproxy.metric.model.ConsumerId; import ai.vespa.metricsproxy.metric.model.DimensionId; import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.Set; /** * @author gjoranv */ public final class AggregationKey { private final Map dimensions; private final Set consumers; public AggregationKey(Map dimensions, Set consumers) { this.dimensions = dimensions; this.consumers = consumers; } public Map getDimensions() { return Collections.unmodifiableMap(dimensions); } public Set getConsumers() { return Collections.unmodifiableSet(consumers); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AggregationKey that = (AggregationKey) o; return Objects.equals(dimensions, that.dimensions) && Objects.equals(consumers, that.consumers); } @Override public int hashCode() { return Objects.hash(dimensions, consumers); } }