public static Map<String, AttributeDefinition> from(final Resource resource) {
        return FunctionUtils.doIfNotNull(resource,
            () -> {
                try (val is = resource.getInputStream()) {
                    LOGGER.trace("Loading attribute definitions from [{}]", resource);
                    val json = new String(is.readAllBytes(), StandardCharsets.UTF_8);
                    LOGGER.trace("Loaded attribute definitions [{}] from [{}]", json, resource);
                    return MAPPER.readValue(JsonValue.readHjson(json).toString(), new TypeReference<>() {
                    });
                }
            }, Map::<String, AttributeDefinition>of).get();
    }
From resource.

@param resource the resource
@return the map
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/attribute/DefaultAttributeDefinitionStore.java