SimpleSortField extends SortField { @Override public String toString() { return MoreObjects.toStringHelper(this).add("field", field).add("reverse", reverse).toString(); } SimpleSortField(String field, Boolean reverse); String getField(); @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; }
@Test public void testToString() { SimpleSortField sortField = new SimpleSortField("field", null); assertEquals("Method #toString is wrong", "SimpleSortField{field=field, reverse=false}", sortField.toString()); }