@Test public void format_RangeMonthPeriod() { MonthPeriod value = new MonthPeriod(2009, 10, 2009, 11); assertEquals("10/2009-11/2009", formatter.format(value)); }
@Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); }
PointMonthPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); } }
PointMonthPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); }  }
PointMonthPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); }  @Override String format(Object value); @Override boolean handles(Class<?> valueClass); @Value("1") @Override void setOrder(int order); }
PointMonthPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); }  @Override String format(Object value); @Override boolean handles(Class<?> valueClass); @Value("1") @Override void setOrder(int order);  }