@Override public int compare(ShoeValueObjectGwt o1, ShoeValueObjectGwt o2) { if (o1 == o2) { return 0; } if (o1 != null) { if (o1.getStartDate() == null) { return -1; } else if (o2.getStartDate() == null) { return 1; } else { return (o2 != null) ? -1 * o1.getStartDate().compareTo(o2.getStartDate()) : -1; } } return -1; }
private void onLoadShoesSuccess(Collection<ShoeValueObjectGwt> _shoes) { m_shoes.clear(); for (ShoeValueObjectGwt shoe : _shoes) { shoe.setStartDate(GwtDateUtil.getLocalDate(shoe.getStartDate())); m_shoes.add(shoe); } Collections.sort(m_shoes, m_shoeSorter); m_handlerManager.fireEvent(new DataChangedEvent(ChangedData.Shoe, DataAction.Load)); }