Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kderusso committed May 3, 2024
1 parent 4b30b6a commit c0ec664
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.IOException;
import java.util.Map;
import java.util.Objects;

public class WeightedToken implements Writeable, ToXContentFragment {

Expand Down Expand Up @@ -76,4 +77,17 @@ public static WeightedToken fromXContent(XContentParser parser) {
throw new ParsingException(parser.getTokenLocation(), e.getMessage(), e);
}
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WeightedToken that = (WeightedToken) o;
return Float.compare(weight, that.weight) == 0 && Objects.equals(token, that.token);
}

@Override
public int hashCode() {
return Objects.hash(token, weight);
}
}

0 comments on commit c0ec664

Please sign in to comment.