Search in sources :

Example 1 with FederatedAssociationDTO

use of org.wso2.carbon.identity.rest.api.user.association.v1.dto.FederatedAssociationDTO in project identity-api-user by wso2.

the class UserAssociationService method getFederatedAssociationDTO.

private FederatedAssociationDTO getFederatedAssociationDTO(FederatedAssociation federatedAssociation) {
    FederatedAssociationDTO federatedAssociationDTO = new FederatedAssociationDTO();
    federatedAssociationDTO.setId(federatedAssociation.getId());
    federatedAssociationDTO.setFederatedUserId(federatedAssociation.getFederatedUserId());
    IdpDTO idpDTO = new IdpDTO();
    idpDTO.setId(federatedAssociation.getIdp().getId());
    idpDTO.setName(federatedAssociation.getIdp().getName());
    if (federatedAssociation.getIdp().getDisplayName() == null) {
        idpDTO.setDisplayName(StringUtils.EMPTY);
    } else {
        idpDTO.setDisplayName(federatedAssociation.getIdp().getDisplayName());
    }
    if (federatedAssociation.getIdp().getImageUrl() == null) {
        idpDTO.setImageUrl(StringUtils.EMPTY);
    } else {
        idpDTO.setImageUrl(federatedAssociation.getIdp().getImageUrl());
    }
    federatedAssociationDTO.setIdp(idpDTO);
    return federatedAssociationDTO;
}
Also used : FederatedAssociationDTO(org.wso2.carbon.identity.rest.api.user.association.v1.dto.FederatedAssociationDTO) IdpDTO(org.wso2.carbon.identity.rest.api.user.association.v1.dto.IdpDTO)

Aggregations

FederatedAssociationDTO (org.wso2.carbon.identity.rest.api.user.association.v1.dto.FederatedAssociationDTO)1 IdpDTO (org.wso2.carbon.identity.rest.api.user.association.v1.dto.IdpDTO)1