Package nl.sidnlabs.dnslib.util
Interface RegisteredDomain
-
public interface RegisteredDomainA 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 Modifier and Type Interface Description static classRegisteredDomain.Type
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Optional<RegisteredDomain>from(String domain)Returns anOptional<RegisteredDomain>representing the registered part of the specified domain.Stringname()Returns the name of the registered domain.StringpublicSuffix()Returns the public suffix of the registered domain.RegisteredDomain.Typetype()Returns the type of the registered domain.
-
-
-
Method Detail
-
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
static Optional<RegisteredDomain> from(String domain)
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
-
-