@Test(expected = NullPointerException.class) public void convert_NullValue() { converter.convert(null, mock(XSettings.class)); }
@Override public YearPeriod convert(String value, XSettings xsettings) { Preconditions.checkNotNull(value); Preconditions.checkNotNull(xsettings); LocalDate startDate = SearchDateTimeUtils.convertISOStringToDate(value); Period period = xdateRangeUtils.getDateRange(xsettings).getGap(); LocalDate endDate = xdateRangeUtils.generateEndDate(startDate, period); return new YearPeriod(startDate.getYear(), endDate.getYear()); }
FacetYearPeriodValueConverter implements FacetValueConverter { @Override public YearPeriod convert(String value, XSettings xsettings) { Preconditions.checkNotNull(value); Preconditions.checkNotNull(xsettings); LocalDate startDate = SearchDateTimeUtils.convertISOStringToDate(value); Period period = xdateRangeUtils.getDateRange(xsettings).getGap(); LocalDate endDate = xdateRangeUtils.generateEndDate(startDate, period); return new YearPeriod(startDate.getYear(), endDate.getYear()); } }
FacetYearPeriodValueConverter implements FacetValueConverter { @Override public YearPeriod convert(String value, XSettings xsettings) { Preconditions.checkNotNull(value); Preconditions.checkNotNull(xsettings); LocalDate startDate = SearchDateTimeUtils.convertISOStringToDate(value); Period period = xdateRangeUtils.getDateRange(xsettings).getGap(); LocalDate endDate = xdateRangeUtils.generateEndDate(startDate, period); return new YearPeriod(startDate.getYear(), endDate.getYear()); }  }
FacetYearPeriodValueConverter implements FacetValueConverter { @Override public YearPeriod convert(String value, XSettings xsettings) { Preconditions.checkNotNull(value); Preconditions.checkNotNull(xsettings); LocalDate startDate = SearchDateTimeUtils.convertISOStringToDate(value); Period period = xdateRangeUtils.getDateRange(xsettings).getGap(); LocalDate endDate = xdateRangeUtils.generateEndDate(startDate, period); return new YearPeriod(startDate.getYear(), endDate.getYear()); }  @Override YearPeriod convert(String value, XSettings xsettings); @Override boolean handles(XSettings xsettings); @Autowired void setXdateRangeUtils(XDateRangeUtils xdateRangeUtils); }
FacetYearPeriodValueConverter implements FacetValueConverter { @Override public YearPeriod convert(String value, XSettings xsettings) { Preconditions.checkNotNull(value); Preconditions.checkNotNull(xsettings); LocalDate startDate = SearchDateTimeUtils.convertISOStringToDate(value); Period period = xdateRangeUtils.getDateRange(xsettings).getGap(); LocalDate endDate = xdateRangeUtils.generateEndDate(startDate, period); return new YearPeriod(startDate.getYear(), endDate.getYear()); }  @Override YearPeriod convert(String value, XSettings xsettings); @Override boolean handles(XSettings xsettings); @Autowired void setXdateRangeUtils(XDateRangeUtils xdateRangeUtils);  }