/** * Sets a attribute value of this person. If the value is blank then any existing attribute will * be voided. * * @param attrTypeUuid the attribute type UUID * @param value the value */ protected void setAsAttribute(String attrTypeUuid, String value) { PersonAttribute attr = findFirstAttribute(attrTypeUuid); if (StringUtils.isNotBlank(value)) { if (attr == null) { attr = new PersonAttribute(); attr.setAttributeType(MetadataUtils.existing(PersonAttributeType.class, attrTypeUuid)); attr.setValue(value); target.addAttribute(attr); } else { attr.setValue(value); } } else if (attr != null) { attr.setVoided(true); attr.setDateVoided(new Date()); attr.setVoidedBy(Context.getAuthenticatedUser()); } }