class UserProfileHandler implements LoggableResource {

    protected void cleanupUserProfile(final JsonObject profile, final Handler<JsonObject> profileCallback) {
        log.debug("About to remove 'not allowed' properties from user profile");
        JsonObject profileCopy = profile.copy();
        Set<String> profileFieldNames = profileCopy.fieldNames();
        profileFieldNames.stream().filter(fieldName -> !userProfileConfiguration.isAllowedProfileProperty(fieldName)).forEach(fieldName -> {
            log.debug("Removing property '" + fieldName + "' from user profile");
            profile.remove(fieldName);
        });
        profileCallback.handle(profile);
    }

    public  UserProfileHandler(Vertx vertx, ResourceStorage storage, UserProfileConfiguration userProfileConfiguration);
    @Deprecated public  UserProfileHandler(Vertx vertx, ResourceStorage storage, LoggingResourceManager loggingResourceManager, UserProfileConfiguration userProfileConfiguration);

}