Class CaseInsensitiveAttributeExtractor

java.lang.Object
de.captaingoldfish.scim.sdk.common.utils.AttributeExtractor
de.captaingoldfish.scim.sdk.common.utils.CaseInsensitiveAttributeExtractor

public class CaseInsensitiveAttributeExtractor extends AttributeExtractor
author Pascal Knueppel
created at: 23.07.2022 - 13:22

used to extract an attribute from a json document case-insensitive
  • Field Summary

    Fields inherited from class de.captaingoldfish.scim.sdk.common.utils.AttributeExtractor

    jsonDocument
  • Constructor Summary

    Constructors
    Constructor
    Description
    CaseInsensitiveAttributeExtractor(com.fasterxml.jackson.databind.JsonNode jsonDocument)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<com.fasterxml.jackson.databind.JsonNode>
    getAttribute(SchemaAttribute schemaAttribute)
    will try to extract an attribute from the json document case-insensitive:
    try to extract it by its correct attribute name from the json document if not found try to extract it from the attributeMap if not found iterate over the document and store each found element with its key value in lowercase in the attributeMap until found

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaseInsensitiveAttributeExtractor

      public CaseInsensitiveAttributeExtractor(com.fasterxml.jackson.databind.JsonNode jsonDocument)
  • Method Details

    • getAttribute

      public Optional<com.fasterxml.jackson.databind.JsonNode> getAttribute(SchemaAttribute schemaAttribute)
      will try to extract an attribute from the json document case-insensitive:
      1. try to extract it by its correct attribute name from the json document
      2. if not found try to extract it from the attributeMap
      3. if not found iterate over the document and store each found element with its key value in lowercase in the attributeMap until found
      Specified by:
      getAttribute in class AttributeExtractor
      Parameters:
      schemaAttribute - the attribute that should be extracted from the document
      Returns:
      the attribute or an empty if not found