Package nl.sidnlabs.dnslib.util
Interface RegisteredDomain
public interface RegisteredDomain
A domain that is registered under a "public suffix". The public suffix is a top-level domain
under which names can be registered. For example, "com" and "co.uk" are public suffixes, and
"example.com" and "example.co.uk" are registered domains.
The primary purpose of this class is to determine if domains are safe to use in various use-cases.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<RegisteredDomain>Returns anOptional<RegisteredDomain>representing the registered part of the specified domain.name()Returns the name of the registered domain.Returns the public suffix of the registered domain.type()Returns the type of the registered domain.
-
Method Details
-
name
String name()Returns the name of the registered domain.- Returns:
- the name of the registered domain
-
type
RegisteredDomain.Type type()Returns the type of the registered domain.- Returns:
- the type of the registered domain
-
publicSuffix
String publicSuffix()Returns the public suffix of the registered domain.- Returns:
- the public suffix of the registered domain
-
from
Returns anOptional<RegisteredDomain>representing the registered part of the specified domain.- Parameters:
domain- the domain name- Returns:
- an
Optional<RegisteredDomain>; theOptionalis empty if the domain is unknown or not registerable - Throws:
NullPointerException- if domain is null
-