GeoDistanceSortField extends SortField { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("field", field) .add("reverse", reverse) .add("latitude", latitude) .add("longitude", longitude) .toString(); } GeoDistanceSortField(String field, Boolean reverse, double latitude, double longitude); @Override org.apache.lucene.search.SortField sortField(Schema schema); Set<String> postProcessingFields(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final String field; final double latitude; final double longitude; }
@Test public void testToString() { GeoDistanceSortField sortField = new GeoDistanceSortField("field", true, 0.0, 0.0); assertEquals("Method #toString is wrong", "GeoDistanceSortField{field=field, reverse=true, latitude=0.0, longitude=0.0}", sortField.toString()); }