protected void mapAttributesToSchema(final Principal principal,
                                         final ScimUserSchema schema,
                                         final Consumer<String> consumer) {
        Optional.ofNullable(scimProperties.getSchemaMappings().get(schema.getName()))
            .map(attribute -> getPrincipalAttributeValues(principal, attribute))
            .ifPresent(values -> values.forEach(value -> consumer.accept(value.toString())));

    }
This is {@link DefaultScimPrincipalAttributeMapper}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-scim-core/src/main/java/org/apereo/cas/scim/v2/provisioning/DefaultScimPrincipalAttributeMapper.java