Class PathUtils

java.lang.Object
io.github.perplexhub.rsql.PathUtils

public class PathUtils extends Object
  • Method Details

    • findMappingOnBeginning

      public static Optional<String> findMappingOnBeginning(String path, Map<String,String> mapping)
      If the beginning of the property path is mapped, replace it with the mapped value.
      Parameters:
      path - the original property path
      mapping - the property path mapper
      Returns:
      the mapped property path
    • findMappingOnWhole

      public static Optional<String> findMappingOnWhole(String path, Map<String,String> mapping)
      If the whole property path is mapped, replace it with the mapped value.
      Parameters:
      path - the original property path
      mapping - the property path mapper
      Returns:
      the mapped property path
    • expectBestMapping

      public static String expectBestMapping(String path, Map<String,String> mapping)
      Try to find the best mapping for the property path by checking the whole path first, then the beginning, and finally the original path.
      Parameters:
      path - the original property path
      mapping - the property path mapper
      Returns:
      the mapped property path