DateRangeMapper extends MultipleColumnMapper { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("field", field) .add("validated", validated) .add("from", from) .add("to", to) .add("pattern", parser) .toString(); } DateRangeMapper(String field, Boolean validated, String from, String to, String pattern); @Override List<IndexableField> indexableFields(Columns columns); @Override SortField sortField(String name, boolean reverse); NRShape makeShape(Date from, Date to); Date base(Object value); @Override String toString(); final String from; final String to; final DateParser parser; final NumberRangePrefixTreeStrategy strategy; }
@Test public void testToString() { DateRangeMapper mapper = dateRangeMapper("from", "to").validated(true).pattern("yyyy/MM/dd").build("field"); String exp = "DateRangeMapper{field=field, validated=true, from=from, to=to, pattern=yyyy/MM/dd}"; assertEquals("Method #toString is wrong", exp, mapper.toString()); }