net.i2p.apache.http.conn.util

## Class PublicSuffixMatcher

- java.lang.Object
- - net.i2p.apache.http.conn.util.PublicSuffixMatcher

-     public final class PublicSuffixMatcher
      extends Object

  Utility class that can test if DNS names match the content of the Public Suffix List.

  An up-to-date list of suffixes can be obtained from publicsuffix.org

  See Also:
    `PublicSuffixList`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PublicSuffixMatcher(Collection<String> rules, Collection<String> exceptions)` Create public suffix matcher.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDomainRoot(String domain)` Returns registrable part of the domain for the given domain name of `null` if given domain represents a public suffix.
    `boolean` | `matches(String domain)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PublicSuffixMatcher

          public PublicSuffixMatcher(Collection<String> rules,
                                     Collection<String> exceptions)

      Create public suffix matcher.
      Parameters:
        `rules` - domain suffix rules
        `exceptions` - domain suffix exceptions

  - ### Method Detail

    - #### getDomainRoot

          public String getDomainRoot(String domain)

      Returns registrable part of the domain for the given domain name of `null` if given domain represents a public suffix.
      Parameters:
        `domain` - the domain name to check
      Returns:
        domain root

    - #### matches

          public boolean matches(String domain)