use of eu.bcvsolutions.idm.ic.impl.IcAttributeImpl in project CzechIdMng by bcvsolutions.
the class DefaultVsAccountService method getIcAttribute.
/**
* Load data from extended attribute and create IcAttribute
*
* @param accountId
* @param name
* @return
*/
@Override
public IcAttribute getIcAttribute(UUID accountId, String name, IdmFormDefinitionDto formDefinition) {
IdmFormAttributeDto attributeDefinition = this.formAttributeService.findAttribute(formDefinition.getType(), formDefinition.getCode(), name);
List<IdmFormValueDto> values = this.formService.getValues(accountId, VsAccount.class, formDefinition, name);
IcAttributeImpl attribute = new IcAttributeImpl();
attribute.setMultiValue(attributeDefinition.isMultiple());
attribute.setName(name);
if (CollectionUtils.isEmpty(values)) {
return attribute;
}
List<Object> valuesObject = values.stream().map(IdmFormValueDto::getValue).collect(Collectors.toList());
attribute.setValues(valuesObject);
return attribute;
}
Aggregations