/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof StatsMonitor)) { return false; } final StatsMonitor m = (StatsMonitor) obj; return baseConfig.equals(m.baseConfig) && monitors.equals(m.monitors); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ConfigUnit that = (ConfigUnit) o; return config.equals(that.config) && unit == that.unit; }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof BasicCounter)) { return false; } BasicCounter m = (BasicCounter) obj; return config.equals(m.getConfig()) && count.get() == m.count.get(); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AnnotatedStringMonitor)) { return false; } AnnotatedStringMonitor m = (AnnotatedStringMonitor) obj; return config.equals(m.getConfig()) && field.equals(m.field); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof CompositeMonitorWrapper<?>)) { return false; } @SuppressWarnings("unchecked") CompositeMonitorWrapper<T> m = (CompositeMonitorWrapper<T>) obj; return config.equals(m.getConfig()) && monitor.equals(m.monitor); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof BasicGauge)) { return false; } BasicGauge m = (BasicGauge) obj; return config.equals(m.getConfig()) && function.equals(m.function); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof AnnotatedNumberMonitor)) { return false; } AnnotatedNumberMonitor m = (AnnotatedNumberMonitor) obj; return config.equals(m.getConfig()) && field.equals(m.field); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof MonitorWrapper<?>)) { return false; } MonitorWrapper m = (MonitorWrapper) obj; return config.equals(m.getConfig()) && monitor.equals(m.monitor); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DoubleCounter that = (DoubleCounter) o; return config.equals(that.config) && Objects.equals(getValue(0), that.getValue(0)); }
@Override public boolean equals(Object obj) { if (!(obj instanceof AtlasMetric)) { return false; } AtlasMetric m = (AtlasMetric) obj; return config.equals(m.getConfig()) && start == m.getStartTime() && Double.compare(value, m.value) == 0; }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof BasicCompositeMonitor)) { return false; } BasicCompositeMonitor m = (BasicCompositeMonitor) obj; return config.equals(m.getConfig()) && monitors.equals(m.getMonitors()); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StepCounter that = (StepCounter) o; return config.equals(that.config) && getCount(0) == that.getCount(0); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof NumberGauge)) { return false; } final NumberGauge that = (NumberGauge) o; return config.equals(that.config) && getValue().equals(that.getValue()); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LongGauge that = (LongGauge) o; return getConfig().equals(that.getConfig()) && getValue(0).equals(that.getValue(0)); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof Metric)) { return false; } Metric m = (Metric) obj; return config.equals(m.getConfig()) && timestamp == m.getTimestamp() && value.equals(m.getValue()); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || !(obj instanceof MaxGauge)) { return false; } MaxGauge m = (MaxGauge) obj; return config.equals(m.getConfig()) && getValue(0).equals(m.getValue(0)); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DoubleGauge that = (DoubleGauge) o; return getConfig().equals(that.getConfig()) && getValue().equals(that.getValue()); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null || !(obj instanceof MinGauge)) { return false; } MinGauge m = (MinGauge) obj; return config.equals(m.getConfig()) && getValue(0).equals(m.getValue(0)); }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || !(obj instanceof DoubleMaxGauge)) { return false; } DoubleMaxGauge m = (DoubleMaxGauge) obj; return config.equals(m.getConfig()) && getValue(0).equals(m.getValue(0)); }
@Test public void testEquals() throws Exception { MonitorConfig m1 = new MonitorConfig.Builder("a").withTags(tags1).build(); MonitorConfig m2 = new MonitorConfig.Builder("a").withTags(tags2).build(); MonitorConfig m3 = new MonitorConfig.Builder("a").withTags(tags1).build(); assertNotNull(m1); assertFalse(m1.toString().equals(m2.toString())); assertTrue(m1.equals(m1)); assertFalse(m1.equals(m2)); assertTrue(m1.equals(m3)); }