default <T extends AttributeDefinition> Optional<T> locateAttributeDefinitionByName(final String name, final Class<T> clazz) {
        return locateAttributeDefinitionByName(name).map(clazz::cast);
    }
Locate attribute definition by name optional.

@param <T>   the type parameter
@param name  the name
@param clazz the clazz
@return the optional
api/cas-server-core-api-services/src/main/java/org/apereo/cas/authentication/attribute/AttributeDefinitionStore.java