public UserProfile newProfile(final Object... parameters) {
        if (restoreProfileFromTypedId) {
            val typedId = getParameter(parameters, 0);
            if (typedId instanceof String sTypedId) {
                logger.debug("Building user profile based on typedId: {}", typedId);
                if (sTypedId.contains(Pac4jConstants.TYPED_ID_SEPARATOR)) {
                    val profileClass = StringUtils.substringBefore(sTypedId, Pac4jConstants.TYPED_ID_SEPARATOR);
                    for (val profileClassPrefix : ProfileHelper.getProfileClassPrefixes()) {
                        if (profileClass.startsWith(profileClassPrefix)) {
                            try {
                                return ProfileHelper.buildUserProfileByClassCompleteName(profileClass);
                            } catch (final TechnicalException e) {
                                logger.error("Cannot build instance for class name: {}", profileClass, e);
                            }
                        }
                    }
                }
            }
        }
        return profileFactory.apply(parameters);
    }
Return the new built or restored profile.

@param parameters some input parameters (the first optional one is the typed id)
@return the new built or restored profile
pac4j-core/src/main/java/org/pac4j/core/profile/definition/ProfileDefinition.java