/** * Gets the value of the first active attribute of the given type. By using the UUID of the * attribute type this avoids forcing us to keep re-fetching attribute types via service methods * which can be slow. * * @param attrTypeUuid the attribute type UUID * @return the value or null */ protected PersonAttribute findFirstAttribute(String attrTypeUuid) { if (target.getAttributes() != null) { for (PersonAttribute attr : target.getAttributes()) if (attr.getAttributeType().getUuid().equals(attrTypeUuid) && !attr.isVoided()) { return attr; } } return null; }