@Test public void testEquals() throws Exception { MetricKey victim = new MetricKey(); MetricKey other = new MetricKey(); assertTrue("Two newly created MetricKeys should be equal.", victim.equals(other)); assertFalse("Equal comparison with null should return false.", victim.equals(null)); assertFalse("Equal comparison with different class type should return false.", victim.equals(Integer.valueOf(3))); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metricKey.name != null) return false; if (tags != null ? !tags.equals(metricKey.tags) : metricKey.tags != null) return false; if (id != null ? !id.equals(metricKey.id) : metricKey.id != null) return false; return true; }
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metricKey.name != null) return false; if (tags != null ? !tags.equals(metricKey.tags) : metricKey.tags != null) return false; if (id != null ? !id.equals(metricKey.id) : metricKey.id != null) return false; return true; } }
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metricKey.name != null) return false; if (tags != null ? !tags.equals(metricKey.tags) : metricKey.tags != null) return false; if (id != null ? !id.equals(metricKey.id) : metricKey.id != null) return false; return true; }  }
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metricKey.name != null) return false; if (tags != null ? !tags.equals(metricKey.tags) : metricKey.tags != null) return false; if (id != null ? !id.equals(metricKey.id) : metricKey.id != null) return false; return true; }  @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); static MetricKey fromValue(MetricSpecification spec); static MetricKey fromValue(String name, String metric, String tags); String toString(); @Override String getShortcut(); }
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metricKey.name != null) return false; if (tags != null ? !tags.equals(metricKey.tags) : metricKey.tags != null) return false; if (id != null ? !id.equals(metricKey.id) : metricKey.id != null) return false; return true; }  @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); static MetricKey fromValue(MetricSpecification spec); static MetricKey fromValue(String name, String metric, String tags); String toString(); @Override String getShortcut();  }