Package de.adrianlange.mcd.strategy
Class EmailAddress.DomainPart
- java.lang.Object
-
- de.adrianlange.mcd.strategy.EmailAddress.DomainPart
-
- Enclosing class:
- EmailAddress
public static class EmailAddress.DomainPart extends Object
Internal representation of the domain part of an email address.
The domain part of an email john.doe+some-verp@example.com is example.com.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()static EmailAddress.DomainPartof(String domainPart)Creates a new domain part.static EmailAddress.DomainPartofIdn(String idnDomainPart)Creates a new domain part from an IDN domain.static EmailAddress.DomainPartofUnicode(String unicodeDomainPart)Creates a new domain part from a unicode domain.StringtoIdn()Returns the domain part as IDN string.StringtoString()StringtoUnicode()Returns the domain part as unicode string.
-
-
-
Method Detail
-
toUnicode
public String toUnicode()
Returns the domain part as unicode string.- Returns:
- Domain part as unicode string
-
toIdn
public String toIdn()
Returns the domain part as IDN string.- Returns:
- Domain part as IDN string
-
of
public static EmailAddress.DomainPart of(String domainPart)
Creates a new domain part. UseofUnicode(String)orofIdn(String)if you know the domain format.- Parameters:
domainPart- String representation of the domain part, must not be null- Returns:
- new DomainPart object created from the given string representation
-
ofUnicode
public static EmailAddress.DomainPart ofUnicode(String unicodeDomainPart)
Creates a new domain part from a unicode domain. IDN domain parts must useofIdn(String).- Parameters:
unicodeDomainPart- String representation of the domain part, must not be null- Returns:
- new DomainPart object created from the given string representation
-
ofIdn
public static EmailAddress.DomainPart ofIdn(String idnDomainPart)
Creates a new domain part from an IDN domain. Unicode domain parts must useofUnicode(String).- Parameters:
idnDomainPart- String representation of the domain part, must not be null- Returns:
- new DomainPart object created from the given string representation
-
-