mirror of https://github.com/apache/cassandra
Add equals/hashCode to RangeTermTree$Term to make sure it plays nicely with IntervalNode construction
patch by Caleb Rackliffe; reviewed by Ariel Weisberg for CASSANDRA-20866
This commit is contained in:
parent
61959e215c
commit
c12cc0b026
|
|
@ -21,6 +21,7 @@ package org.apache.cassandra.index.sai.view;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -124,5 +125,19 @@ public class RangeTermTree
|
|||
{
|
||||
return MoreObjects.toStringHelper(this).add("term", indexTermType.asString(term)).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if (other == null || getClass() != other.getClass()) return false;
|
||||
Term otherTerm = (Term) other;
|
||||
return Objects.equals(term, otherTerm.term) && Objects.equals(indexTermType, otherTerm.indexTermType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(term, indexTermType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue