Class JsonUtils

java.lang.Object
org.keycloak.utils.JsonUtils

public class JsonUtils extends Object
Utility methods for manipulating JSON objects.
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • splitClaimPath

      public static List<String> splitClaimPath(String claim)
      Splits the given claim into separate paths if the value contains separators as per CLAIM_COMPONENT.
      Parameters:
      claim - the claim
      Returns:
      a list with the paths
    • hasPath

      public static boolean hasPath(String claim)
      Determines if the given claim contains paths.
      Parameters:
      claim - the claim
      Returns:
      true if the claim contains paths. Otherwise, false.
    • getJsonValue

      public static Object getJsonValue(com.fasterxml.jackson.databind.JsonNode node, String claim)

      Returns the value corresponding to the given claim.

      Parameters:
      node - the JSON node
      claim - the claim
      Returns:
      the value