@Override
    public SAMLObject build(final SamlProfileBuilderContext context) throws SamlException {
        if (context.getSamlRequest() instanceof AttributeQuery) {
            return determineNameIdForAttributeQuery(context);
        }
        return buildNameId(context);
    }
This is {@link SamlProfileSamlNameIdBuilder}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/nameid/SamlProfileSamlNameIdBuilder.java