public AttributeModel convert(Attribute attribute) { LOGGER.traceEntry(attribute.getName()); AttributeModel model; if (attribute.getId() != null) { model = attributeService.getAttribute(attribute.getId()).orElseGet(AttributeModel::new); } else { model = new AttributeModel(); model.setDisplayName(attribute.getDisplayName()); model.setDataType(attribute.getDataType()); model.setId(attribute.getId()); model.setCatalogId(attribute.getCatalogId()); model.setIndexed(attribute.isIndexed());