/** * {@inheritDoc} */ @Override public int hashCode() { int code = 0; code += ((int)this.getWindowStart()); code += ((int)this.getWindowEnd()); return code; }
/** * {@inheritDoc} * * @deprecated since 1.13. Use {@link #serialize(IValueSerializer)} with an array serializer instead. */ @Override @Deprecated public Object[] toArray() { return new Object[] { this.getWindowStart(), this.getWindowEnd() }; } /**
/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != this.getClass()) return false; final AggregationWindow castedRecord = (AggregationWindow) obj; if (this.getLoggingTimestamp() != castedRecord.getLoggingTimestamp()) return false; if (this.getWindowStart() != castedRecord.getWindowStart()) return false; if (this.getWindowEnd() != castedRecord.getWindowEnd()) return false; return true; }
/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != this.getClass()) { return false; } final AggregationWindow castedRecord = (AggregationWindow) obj; if (this.getLoggingTimestamp() != castedRecord.getLoggingTimestamp()) { return false; } if (this.getWindowStart() != castedRecord.getWindowStart()) { return false; } if (this.getWindowEnd() != castedRecord.getWindowEnd()) { return false; } return true; } /**
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putLong(this.getWindowStart()); serializer.putLong(this.getWindowEnd()); } /**
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putLong(this.getWindowStart()); serializer.putLong(this.getWindowEnd()); }
/** * Tests {@link AggregationWindow#TestAggregationWindow(long, long)}. */ @Test public void testParameterConstruction() { // NOPMD (assert missing) for (int i = 0; i < ARRAY_LENGTH; i++) { // initialize final AggregationWindow record = new AggregationWindow(LONG_VALUES.get(i % LONG_VALUES.size()), LONG_VALUES.get(i % LONG_VALUES.size())); // check values Assert.assertEquals("AggregationWindow.windowStart values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getWindowStart()); Assert.assertEquals("AggregationWindow.windowEnd values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getWindowEnd()); } }
/** * Tests {@link AggregationWindow#TestAggregationWindow(long, long)}. */ @Test public void testBuffer() { // NOPMD (assert missing) for (int i = 0; i < ARRAY_LENGTH; i++) { // initialize final AggregationWindow record = new AggregationWindow(LONG_VALUES.get(i % LONG_VALUES.size()), LONG_VALUES.get(i % LONG_VALUES.size())); // check values Assert.assertEquals("AggregationWindow.windowStart values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getWindowStart()); Assert.assertEquals("AggregationWindow.windowEnd values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getWindowEnd()); } }