code: protected static SAML2StringNameIDEncoder prepareNameIdEncoder(final RequestAbstractType authnRequest,
                                                                     final String nameFormat,
                                                                     final IdPAttribute attribute,
                                                                     final SamlRegisteredService service,
                                                                     final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) {
          val encoder = new SAML2StringNameIDEncoder();
          encoder.setNameFormat(nameFormat);
          if (getNameIDPolicy(authnRequest) != null) {
              val qualifier = getNameIDPolicy(authnRequest).getSPNameQualifier();
              LOGGER.debug("NameID qualifier is set to [{}]", qualifier);
              encoder.setNameQualifier(qualifier);
          }
          return encoder;
      }
docs: Prepare name id encoder saml 2 string name id encoder.
  
  @param authnRequest the authn request
  @param nameFormat   the name format
  @param attribute    the attribute
  @param service      the service
  @param adaptor      the adaptor
  @return the saml 2 string name id encoder