public static String getString(final LdapEntry entry, final String attribute, final String nullValue) {
        val attr = entry.getAttribute(attribute);
        if (attr == null) {
            return nullValue;
        }

        val v = attr.isBinary()
            ? new String(attr.getBinaryValue(), StandardCharsets.UTF_8)
            : attr.getStringValue();

        if (StringUtils.isNotBlank(v)) {
            return v;
        }
        return nullValue;
    }
Reads a String value from the LdapEntry.

@param entry     the ldap entry
@param attribute the attribute name
@param nullValue the value which should be returning in case of a null value
@return the string
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java