private Attendee convertAttendee(UserDataRequest udr, Event oldEvent) { ParticipationState oldState = ParticipationState.NEEDSACTION; if (oldEvent != null) { for (Attendee oldAtt : oldEvent.getAttendees()) { if (oldAtt.getEmail().equals(udr.getCredentials().getUser().getEmail())) { oldState = oldAtt.getState(); break; } } } Attendee ret = new Attendee(); ret.setEmail(udr.getCredentials().getUser().getEmail()); ret.setParticipationRole(ParticipationRole.REQ); ret.setState(status(oldState, AttendeeStatus.ACCEPT)); return ret; }