if (event.getEnd().getDateTime() != null) {
result.setAllDay(event.getEnd().getDateTime().isDateOnly());
}
result.setLocation(event.getLocation());
if (event.getOrganizer() != null) {
final PersonDto person = new PersonDto();
person.setName(event.getOrganizer().getDisplayName());
person.setEmail(event.getOrganizer().getEmail());
result.setOrganizer(person);
}
if (event.getAttendees() != null) {
final Set<PersonDto> attendees = new HashSet<PersonDto>();
for (final EventAttendee eventAttendee : event.getAttendees()) {
final PersonDto person = new PersonDto();
person.setName(eventAttendee.getDisplayName());
person.setEmail(eventAttendee.getEmail());
if (eventAttendee.getOptional() != null) {
person.setOptional(eventAttendee.getOptional());
}
attendees.add(person);
}
result.setAttendees(attendees);
}