Exemple #1
0
 /**
  * Hashcode is calculated from String of the regular expression generated from the template.
  *
  * @return the hash code.
  */
 @Override
 public final int hashCode() {
   return pattern.hashCode();
 }
Exemple #2
0
  /**
   * Match a URI against the template.
   *
   * <p>If the URI matches against the pattern then the template variable to value map will be
   * filled with template variables as keys and template values as values.
   *
   * <p>
   *
   * @param uri the uri to match against the template.
   * @param groupValues the list to store the values of a pattern's capturing groups is matching is
   *     successful. The values are stored in the same order as the pattern's capturing groups.
   * @return true if the URI matches the template, otherwise false.
   * @throws IllegalArgumentException if the uri or templateVariableToValue is null.
   */
  public final boolean match(CharSequence uri, List<String> groupValues)
      throws IllegalArgumentException {
    if (groupValues == null) throw new IllegalArgumentException();

    return pattern.match(uri, groupValues);
  }
Exemple #3
0
 @Override
 public final String toString() {
   return pattern.toString();
 }
Exemple #4
0
  /**
   * Match a URI against the template.
   *
   * <p>If the URI matches against the pattern then the template variable to value map will be
   * filled with template variables as keys and template values as values.
   *
   * <p>
   *
   * @param uri the uri to match against the template.
   * @param templateVariableToValue the map where to put template variables (as keys) and template
   *     values (as values). The map is cleared before any entries are put.
   * @return true if the URI matches the template, otherwise false.
   * @throws IllegalArgumentException if the uri or templateVariableToValue is null.
   */
  public final boolean match(CharSequence uri, Map<String, String> templateVariableToValue)
      throws IllegalArgumentException {
    if (templateVariableToValue == null) throw new IllegalArgumentException();

    return pattern.match(uri, templateVariables, templateVariableToValue);
  }