Class CommonPathFinder

java.lang.Object
dk.mada.jaxrs.generator.mpclient.CommonPathFinder

public class CommonPathFinder extends Object
REST common path finder.
  • Constructor Details

    • CommonPathFinder

      public CommonPathFinder()
  • Method Details

    • findCommonPath

      public String findCommonPath(List<String> paths)
      Find longest common sub-path of the paths provided. First find shortest path, use that as base. From this, build all potential common prefixes, by cutting path elements of. Then simply search this list (which is longest to shortest) for prefixes that matches all paths.
      Parameters:
      paths - the paths to look through
      Returns:
      the longest common path