public class EmailAddress extends Object
| Constructor and Description |
|---|
EmailAddress(String email)
Honestly this is self-documenting code and doesn't need javadoc.
|
| Modifier and Type | Method and Description |
|---|---|
EmailAddress |
emailAddressWithDifferentDomain(String newDomain)
Create a version of the current EmailAddress with a different domain.
|
String |
getAddress() |
String |
getDomain() |
String |
getTLD() |
boolean |
hasDomain(String domain) |
boolean |
isValid() |
String |
toString()
Returns a string representation of this email address.
|
public EmailAddress(String email)
email - Can you guess what to pass here?public EmailAddress emailAddressWithDifferentDomain(String newDomain)
newDomain - The new domain.public boolean isValid()
public String getTLD()
public String getDomain()
public String getAddress()
public boolean hasDomain(String domain)
domain - i.e. 'hotmail.com'Copyright © 2022. All rights reserved.