IntegerMapper extends SingleColumnMapper.SingleFieldMapper<Integer> { @Override public SortField sortField(String name, boolean reverse) { return new SortedNumericSortField(name, Type.INT, reverse); } IntegerMapper(String field, String column, Boolean validated, Float boost); @Override Optional<Field> indexedField(String name, Integer value); @Override Optional<Field> sortedField(String name, Integer value); @Override SortField sortField(String name, boolean reverse); @Override String toString(); static final Float DEFAULT_BOOST; final Float boost; }
@Test public void testSortField() { IntegerMapper mapper = integerMapper().boost(2.3f).build("field"); SortField sortField = mapper.sortField("field", true); assertNotNull("Sort field is not created", sortField); assertTrue("Sort field reverse is wrong", sortField.getReverse()); }