public int compareTo(CalendarEvent calendarEvent) { int value = 0; value = DateUtil.compareTo(getStartDate(), calendarEvent.getStartDate()); if (value != 0) { return value; } value = getTitle().toLowerCase().compareTo(calendarEvent.getTitle().toLowerCase()); if (value != 0) { return value; } return 0; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } CalendarEvent calendarEvent = null; try { calendarEvent = (CalendarEvent) obj; } catch (ClassCastException cce) { return false; } long primaryKey = calendarEvent.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } }
/** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance */ public static CalendarEvent toModel(CalendarEventSoap soapModel) { CalendarEvent model = new CalendarEventImpl(); model.setUuid(soapModel.getUuid()); model.setCalendarEventId(soapModel.getCalendarEventId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setTitle(soapModel.getTitle()); model.setDescription(soapModel.getDescription()); model.setLocation(soapModel.getLocation()); model.setStartDate(soapModel.getStartDate()); model.setEndDate(soapModel.getEndDate()); model.setDurationHour(soapModel.getDurationHour()); model.setDurationMinute(soapModel.getDurationMinute()); model.setAllDay(soapModel.getAllDay()); model.setRecurrence(soapModel.getRecurrence()); model.setType(soapModel.getType()); model.setRemindBy(soapModel.getRemindBy()); model.setFirstReminder(soapModel.getFirstReminder()); model.setSecondReminder(soapModel.getSecondReminder()); return model; }