1 package com.stateofflow.eclipse.metrics.metric;
2
3 public class MetricPropertyKey {
4 private final MetricId metricId;
5 private final String propertyName;
6
7 public MetricPropertyKey(final MetricId metricId, final String propertyName) {
8 this.metricId = metricId;
9 this.propertyName = propertyName;
10 }
11
12 public int hashCode() {
13 return metricId.hashCode();
14 }
15
16 public boolean equals(final Object obj) {
17 if (obj == this) {
18 return true;
19 }
20
21 if (obj == null || !obj.getClass().equals(getClass())) {
22 return false;
23 }
24
25 final MetricPropertyKey that = (MetricPropertyKey) obj;
26 return metricId.equals(that.metricId) && propertyName.equals(that.propertyName);
27 }
28
29 public String toString() {
30 return metricId + "." + propertyName;
31 }
32 }
33