public static UserContact getDefaultUserContact() { UserContactType type = new UserContactType(); UserContact contact = new UserContact("value", type); contact.setOwner(ObjectsFactory.getDefaultUser()); return contact; }
/** * Copies user contact and sets specified owner for copy. Needed for possibility perform deep copy of user. * @param contact contact to be copied * @param owner user which will be set as copy owner * * @return copy of specified user contact */ @VisibleForTesting static UserContact copyUserContact(UserContact contact, JCUser owner) { if (contact == null) { throw new IllegalArgumentException("User contact should not be null"); } UserContact copy = new UserContact(contact.getValue(), contact.getType()); copy.setOwner(owner); copy.setId(contact.getId()); copy.setUuid(contact.getUuid()); return copy; }
contact.setType(actualType); } else { contact = new UserContact(contactContainer.getValue(), actualType); user.addContact(contact);