docs: public void map(final UserResource user, final Principal p,
                      final Credential credential) {
          user.setUserName(p.getId());
          if (credential instanceof UsernamePasswordCredential) {
              user.setPassword(UsernamePasswordCredential.class.cast(credential).getPassword());
          }
          user.setActive(Boolean.TRUE);
  
          user.setNickName(getPrincipalAttributeValue(p, "nickName"));
          user.setDisplayName(getPrincipalAttributeValue(p, "displayName"));
  
          val name = new Name();
          name.setGivenName(getPrincipalAttributeValue(p, "givenName"));
          name.setFamilyName(getPrincipalAttributeValue(p, "familyName"));
          name.setMiddleName(getPrincipalAttributeValue(p, "middleName"));
  
          user.setName(name);
  
          val email = new Email();
          email.setPrimary(Boolean.TRUE);
          email.setValue(getPrincipalAttributeValue(p, "email"));
          user.setEmails(CollectionUtils.wrap(email));
  
          val phone = new PhoneNumber();
          phone.setPrimary(Boolean.TRUE);
          phone.setValue(getPrincipalAttributeValue(p, "phoneNumber"));
          user.setPhoneNumbers(CollectionUtils.wrap(phone));
      }