@Test public void handles_TRUE_YEAR() { XDateRange dateRange = new XDateRange(new LocalDate(2011, 11, 1), new LocalDate(2012, 12, 12), new Period(1, PeriodUnit.YEAR)); when(xDateRangeUtils.getDateRange(xsettings)).thenReturn(dateRange); assertTrue(converter.handles(xsettings)); }
@Override public boolean handles(XSettings xsettings) { Preconditions.checkNotNull(xsettings); XDateRange range = xdateRangeUtils.getDateRange(xsettings); if (range != null && ( (range.getGap().getUnit().equals(MONTH) && range.getStartDate().getDayOfMonth() == 1) || (range.getGap().getUnit().equals(YEAR) && (range.getStartDate().getDayOfMonth() == 1 && range.getStartDate().getMonthOfYear() != 1)))) { return true; } return false; }
FacetMonthPeriodValueConverter implements FacetValueConverter { @Override public boolean handles(XSettings xsettings) { Preconditions.checkNotNull(xsettings); XDateRange range = xdateRangeUtils.getDateRange(xsettings); if (range != null && ( (range.getGap().getUnit().equals(MONTH) && range.getStartDate().getDayOfMonth() == 1) || (range.getGap().getUnit().equals(YEAR) && (range.getStartDate().getDayOfMonth() == 1 && range.getStartDate().getMonthOfYear() != 1)))) { return true; } return false; } }
FacetMonthPeriodValueConverter implements FacetValueConverter { @Override public boolean handles(XSettings xsettings) { Preconditions.checkNotNull(xsettings); XDateRange range = xdateRangeUtils.getDateRange(xsettings); if (range != null && ( (range.getGap().getUnit().equals(MONTH) && range.getStartDate().getDayOfMonth() == 1) || (range.getGap().getUnit().equals(YEAR) && (range.getStartDate().getDayOfMonth() == 1 && range.getStartDate().getMonthOfYear() != 1)))) { return true; } return false; }  }
FacetMonthPeriodValueConverter implements FacetValueConverter { @Override public boolean handles(XSettings xsettings) { Preconditions.checkNotNull(xsettings); XDateRange range = xdateRangeUtils.getDateRange(xsettings); if (range != null && ( (range.getGap().getUnit().equals(MONTH) && range.getStartDate().getDayOfMonth() == 1) || (range.getGap().getUnit().equals(YEAR) && (range.getStartDate().getDayOfMonth() == 1 && range.getStartDate().getMonthOfYear() != 1)))) { return true; } return false; }  @Override MonthPeriod convert(String value, XSettings xsettings); @Override boolean handles(XSettings xsettings); @Autowired void setXdateRangeUtils(XDateRangeUtils xdateRangeUtils); }
FacetMonthPeriodValueConverter implements FacetValueConverter { @Override public boolean handles(XSettings xsettings) { Preconditions.checkNotNull(xsettings); XDateRange range = xdateRangeUtils.getDateRange(xsettings); if (range != null && ( (range.getGap().getUnit().equals(MONTH) && range.getStartDate().getDayOfMonth() == 1) || (range.getGap().getUnit().equals(YEAR) && (range.getStartDate().getDayOfMonth() == 1 && range.getStartDate().getMonthOfYear() != 1)))) { return true; } return false; }  @Override MonthPeriod convert(String value, XSettings xsettings); @Override boolean handles(XSettings xsettings); @Autowired void setXdateRangeUtils(XDateRangeUtils xdateRangeUtils);  }