# EffectiveTldFinder.EffectiveTLD (Crawler-commons 1.2 API)
Date: 2021-10-08

crawlercommons.domains

## Class EffectiveTldFinder.EffectiveTLD

- java.lang.Object
- - crawlercommons.domains.EffectiveTldFinder.EffectiveTLD

Enclosing class:
  EffectiveTldFinder

    public static class EffectiveTldFinder.EffectiveTLD
    extends Object

EffectiveTLD objects hold one line of the public suffix list:

- the suffix (`com`, `co.uk`, etc.)
- for IDN suffixes: both the ASCII and IDN variant (`xn--p1ai` and `рф`)
- and the properties required to parse host/domain names given in the public suffix list (wildcard suffix, exception, in private domain section)

### Constructor Summary

Constructors
Constructor and Description
`EffectiveTLD(String line, boolean isPrivateDomain)` Parse one non-empty, non-comment line in the public suffix list and hold the public suffix and its properties in the created object.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getDomain()`
`Set<String>` `getNameVariants()` Generate name variants caused by Internationalized Domain Names: every IDN part of a eTLD can be replaced by its punycoded ASCII variant.
`boolean` `isException()`
`boolean` `isWild()`
`String` `toString()`

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

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

### Constructor Detail

#### EffectiveTLD

    public EffectiveTLD(String line,
                        boolean isPrivateDomain)
                 throws IllegalArgumentException

Parse one non-empty, non-comment line in the public suffix list and hold the public suffix and its properties in the created object.

Parameters:
  `line` - non-empty, non-comment line in the public suffix list
  `isPrivateDomain` - whether line is in the section of "PRIVATE DOMAINS" of the public suffix list
Throws:
  `IllegalArgumentException` - if the input line contains non-ASCII Unicode characters prohibited in IDNs, cf. `IDN.toASCII(String)`

### Method Detail

#### getNameVariants

    public Set<String> getNameVariants()

Generate name variants caused by Internationalized Domain Names: every IDN part of a eTLD can be replaced by its punycoded ASCII variant. For two-part IDN eTLDs this will generate 4 variants.

Returns:
  set of variant names

#### getDomain

    public String getDomain()

#### isWild

    public boolean isWild()

#### isException

    public boolean isException()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`