@Test public void ignores_path_variables() { assertTrue(checkPath("/pets/{someVariable}", PathUtils::isSpinalCase)); }
public static boolean checkPath(String path, Predicate<String> segmentChecker) { for (String fragment : path.split("/")) { if (fragment.isEmpty() || isVariable(fragment)) { continue; } if (!segmentChecker.test(fragment)) { return false; } } return true; }
PathUtils { public static boolean checkPath(String path, Predicate<String> segmentChecker) { for (String fragment : path.split("/")) { if (fragment.isEmpty() || isVariable(fragment)) { continue; } if (!segmentChecker.test(fragment)) { return false; } } return true; } }
PathUtils { public static boolean checkPath(String path, Predicate<String> segmentChecker) { for (String fragment : path.split("/")) { if (fragment.isEmpty() || isVariable(fragment)) { continue; } if (!segmentChecker.test(fragment)) { return false; } } return true; } private  PathUtils(); }
PathUtils { public static boolean checkPath(String path, Predicate<String> segmentChecker) { for (String fragment : path.split("/")) { if (fragment.isEmpty() || isVariable(fragment)) { continue; } if (!segmentChecker.test(fragment)) { return false; } } return true; } private  PathUtils(); static boolean isVariable(String fragment); static boolean checkPath(String path, Predicate<String> segmentChecker); static boolean isSpinalCase(String fragment); static boolean isResourcePath(String path); static String terminalSegment(String path); static String trimTrailingSlash(String path); }
PathUtils { public static boolean checkPath(String path, Predicate<String> segmentChecker) { for (String fragment : path.split("/")) { if (fragment.isEmpty() || isVariable(fragment)) { continue; } if (!segmentChecker.test(fragment)) { return false; } } return true; } private  PathUtils(); static boolean isVariable(String fragment); static boolean checkPath(String path, Predicate<String> segmentChecker); static boolean isSpinalCase(String fragment); static boolean isResourcePath(String path); static String terminalSegment(String path); static String trimTrailingSlash(String path); static final Pattern SPINAL_CASE_PATTERN; }