public static Pattern prefixPatternOf(String prefix) {
    checkArgument(NON_LITERAL_REGEX_CHARACTERS.matchesNoneOf(prefix),
        "Prefix [%s] should be literal, otherwise use constructed regex Pattern",
        prefix);
    return Pattern.compile("^" + prefix);
  }
This "host" could accepts {@link ConstraintVisitor}s.
mongo/src/org/immutables/mongo/repository/internal/Constraints.java