Class SemanticVersionPattern

java.lang.Object
com.kazurayam.materialstore.core.metadata.SemanticVersionPattern

public final class SemanticVersionPattern extends Object
  • Constructor Details

    • SemanticVersionPattern

      public SemanticVersionPattern(String baseStr)
  • Method Details

    • matcher

      public Matcher matcher(String leftStr)
      Compare the leftPath and the rightPath are similar. If the 2 strings contain a Semantic Version, then the version is smartly disregarded.

      E.g, (1) "/some/path/x" and "/some/path/x" will return true (2) "/some/path/x" and "/some/path/Y" will return false (3) "/some/path-1.2.0/x" and "/some/path-1.2.3-alpha/x" will return true

      Parameters:
      leftStr - TODO
      Returns:
      if leftStr is identical to the baseStr, return true; otherwise false
    • pattern

      public Pattern pattern()
    • straightMatcher

      public static Matcher straightMatcher(String string)
      returns a java.util.regex.Matcher for the string. The matcher.matches() will return true if the string contains a semantic version like "0.1.2-alpha".
      Parameters:
      string - TODO
      Returns:
      TODO
    • translateToBaseStrToPattern

      public static Pattern translateToBaseStrToPattern(String baseStr)
    • escapeAsRegex

      public static String escapeAsRegex(String path)