@Test public void notEqualToOtherNonStatTypes() { SimpleStat stat = new SimpleStat(); String other = "something"; assertFalse(stat.equals(other)); assertFalse(other.equals(stat)); }
@Override public boolean equals(Object otherObject) { if (!(otherObject instanceof AbstractRollupStat)) { return false; } AbstractRollupStat other = (AbstractRollupStat)otherObject; if (this.isFloatingPoint != other.isFloatingPoint()) { return false; } if (this.isFloatingPoint) { return this.toDouble() == other.toDouble(); } else { return this.toLong() == other.toLong(); } }
AbstractRollupStat { @Override public boolean equals(Object otherObject) { if (!(otherObject instanceof AbstractRollupStat)) { return false; } AbstractRollupStat other = (AbstractRollupStat)otherObject; if (this.isFloatingPoint != other.isFloatingPoint()) { return false; } if (this.isFloatingPoint) { return this.toDouble() == other.toDouble(); } else { return this.toLong() == other.toLong(); } } }
AbstractRollupStat { @Override public boolean equals(Object otherObject) { if (!(otherObject instanceof AbstractRollupStat)) { return false; } AbstractRollupStat other = (AbstractRollupStat)otherObject; if (this.isFloatingPoint != other.isFloatingPoint()) { return false; } if (this.isFloatingPoint) { return this.toDouble() == other.toDouble(); } else { return this.toLong() == other.toLong(); } } AbstractRollupStat(); }
AbstractRollupStat { @Override public boolean equals(Object otherObject) { if (!(otherObject instanceof AbstractRollupStat)) { return false; } AbstractRollupStat other = (AbstractRollupStat)otherObject; if (this.isFloatingPoint != other.isFloatingPoint()) { return false; } if (this.isFloatingPoint) { return this.toDouble() == other.toDouble(); } else { return this.toLong() == other.toLong(); } } AbstractRollupStat(); boolean isFloatingPoint(); double toDouble(); long toLong(); @Override boolean equals(Object otherObject); void setLongValue(long value); void setDoubleValue(double value); abstract byte getStatType(); String toString(); static void set(AbstractRollupStat stat, Number value); }
AbstractRollupStat { @Override public boolean equals(Object otherObject) { if (!(otherObject instanceof AbstractRollupStat)) { return false; } AbstractRollupStat other = (AbstractRollupStat)otherObject; if (this.isFloatingPoint != other.isFloatingPoint()) { return false; } if (this.isFloatingPoint) { return this.toDouble() == other.toDouble(); } else { return this.toLong() == other.toLong(); } } AbstractRollupStat(); boolean isFloatingPoint(); double toDouble(); long toLong(); @Override boolean equals(Object otherObject); void setLongValue(long value); void setDoubleValue(double value); abstract byte getStatType(); String toString(); static void set(AbstractRollupStat stat, Number value);  }