@Test public void multipleAndMoreComplexRegexInformationCanBeRetrievedForParameter() { String nameRegex = "[0-9]*"; String idRegex = "[a-zA-Z0-9\\{](-[a-zA-Z0-9])-[a-zA-Z0-9]{12}"; String id2Regex = "[a-zA-Z0-9\\{](-[a-zA-Z0-9\\}])-[a-zA-Z0-9]{15}"; String emailRegex = "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"" + "(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[" + "\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+" + "[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}" + "(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]" + ":(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]" + "|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"; String path = "/{name: " + nameRegex + "}" + "/x" + "/{id: " + idRegex + "}" + "/{id2: " + id2Regex + "}" + "/{email:" + emailRegex + "}"; Element element = buildElement(path); PathDetails pathDetails = new PathDetails(element); assertThat(pathDetails.getRegex("name")).isEqualTo(nameRegex); assertThat(pathDetails.getRegex("id")).isEqualTo(idRegex); assertThat(pathDetails.getRegex("id2")).isEqualTo(id2Regex); assertThat(pathDetails.getRegex("email")).isEqualTo(emailRegex); }
public String getRegex(String paramName) { return regexes.get(paramName); }
PathDetails { public String getRegex(String paramName) { return regexes.get(paramName); } }
PathDetails { public String getRegex(String paramName) { return regexes.get(paramName); } PathDetails(Element element);  PathDetails(
            Element element,
            PathDetails basePath); }
PathDetails { public String getRegex(String paramName) { return regexes.get(paramName); } PathDetails(Element element);  PathDetails(
            Element element,
            PathDetails basePath); String getValue(); String getRegex(String paramName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
PathDetails { public String getRegex(String paramName) { return regexes.get(paramName); } PathDetails(Element element);  PathDetails(
            Element element,
            PathDetails basePath); String getValue(); String getRegex(String paramName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }