Search in sources :

Example 1 with UserProfileResponse

use of com.sequenceiq.cloudbreak.api.model.UserProfileResponse in project cloudbreak by hortonworks.

the class UserProfileToUserProfileResponseConverter method convert.

@Override
public UserProfileResponse convert(UserProfile entity) {
    UserProfileResponse userProfileResponse = new UserProfileResponse();
    userProfileResponse.setAccount(entity.getAccount());
    userProfileResponse.setOwner(entity.getOwner());
    if (entity.getCredential() != null) {
        CredentialResponse credentialResponse = getConversionService().convert(entity.getCredential(), CredentialResponse.class);
        userProfileResponse.setCredential(credentialResponse);
    }
    Map<String, Object> map = entity.getUiProperties().getMap();
    userProfileResponse.setUiProperties(map == null ? new HashMap<>() : map);
    return userProfileResponse;
}
Also used : UserProfileResponse(com.sequenceiq.cloudbreak.api.model.UserProfileResponse) HashMap(java.util.HashMap) CredentialResponse(com.sequenceiq.cloudbreak.api.model.CredentialResponse)

Aggregations

CredentialResponse (com.sequenceiq.cloudbreak.api.model.CredentialResponse)1 UserProfileResponse (com.sequenceiq.cloudbreak.api.model.UserProfileResponse)1 HashMap (java.util.HashMap)1