@Test public void format_OneYearPeriod() { YearPeriod value = new YearPeriod(2009, 2009); assertEquals("2009", formatter.format(value)); }
@Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); }
PointYearPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); } }
PointYearPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); }  }
PointYearPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); }  @Override String format(Object value); @Override boolean handles(Class<?> valueClass); @Value("1") @Override void setOrder(int order); }
PointYearPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); }  @Override String format(Object value); @Override boolean handles(Class<?> valueClass); @Value("1") @Override void setOrder(int order);  }