Move equals() from Float[Sum|Min|Max]AggregatorFactory to SimpleFloat... (#4675)

Addresses #4671
This commit is contained in:
solimant 2017-08-10 10:22:22 -04:00 committed by Gian Merlino
parent 7c89e12ca9
commit de9ba97d54
4 changed files with 24 additions and 79 deletions

View File

@ -29,7 +29,6 @@ import io.druid.segment.ColumnSelectorFactory;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
*/
@ -123,30 +122,4 @@ public class FloatMaxAggregatorFactory extends SimpleFloatAggregatorFactory
", name='" + name + '\'' +
'}';
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FloatMaxAggregatorFactory that = (FloatMaxAggregatorFactory) o;
if (!Objects.equals(fieldName, that.fieldName)) {
return false;
}
if (!Objects.equals(expression, that.expression)) {
return false;
}
if (!Objects.equals(name, that.name)) {
return false;
}
return true;
}
}

View File

@ -29,7 +29,6 @@ import io.druid.segment.ColumnSelectorFactory;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
*/
@ -130,30 +129,4 @@ public class FloatMinAggregatorFactory extends SimpleFloatAggregatorFactory
", name='" + name + '\'' +
'}';
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FloatMinAggregatorFactory that = (FloatMinAggregatorFactory) o;
if (!Objects.equals(fieldName, that.fieldName)) {
return false;
}
if (!Objects.equals(expression, that.expression)) {
return false;
}
if (!Objects.equals(name, that.name)) {
return false;
}
return true;
}
}

View File

@ -29,7 +29,6 @@ import io.druid.segment.ColumnSelectorFactory;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
*/
@ -124,28 +123,4 @@ public class FloatSumAggregatorFactory extends SimpleFloatAggregatorFactory
", name='" + name + '\'' +
'}';
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FloatSumAggregatorFactory that = (FloatSumAggregatorFactory) o;
if (!Objects.equals(fieldName, that.fieldName)) {
return false;
}
if (!Objects.equals(expression, that.expression)) {
return false;
}
if (!Objects.equals(name, that.name)) {
return false;
}
return true;
}
}

View File

@ -118,4 +118,28 @@ public abstract class SimpleFloatAggregatorFactory extends AggregatorFactory
{
return Objects.hash(fieldName, expression, name);
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SimpleFloatAggregatorFactory that = (SimpleFloatAggregatorFactory) o;
if (!Objects.equals(fieldName, that.fieldName)) {
return false;
}
if (!Objects.equals(expression, that.expression)) {
return false;
}
if (!Objects.equals(name, that.name)) {
return false;
}
return true;
}
}