java.lang.Object
de.powerstat.validation.values.EMail
- All Implemented Interfaces:
IValueObject
,Comparable<EMail>
Electronic mail.
Probably DSGVO relevant.
TODO Hostname exists?
TODO email exists check
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compare with another object.boolean
Is equal with another object.Get emails domain part string.Get emails local part string.Get emails reverse domain part string.int
hashCode()
Calculate hash code.static EMail
EMail factory.Returns the value of this EMail as a string.toString()
Returns the string representation of this EMail.
-
Field Details
-
LOCAL_REGEXP
Local part regexp. -
email
EMail. -
domainPart
EMails domain part. -
localPart
EMails local part.
-
-
Constructor Details
-
EMail
Constructor. Comments, double quotes and UTF-8 characters within the emails local part are not yet supported.- Parameters:
email
- EMail- Throws:
NullPointerException
- if email is nullIllegalArgumentException
- if email is not an supported email address
-
-
Method Details
-
of
EMail factory.- Parameters:
email
- EMail- Returns:
- EMail object
-
stringValue
Returns the value of this EMail as a string.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The text value represented by this object after conversion to type string.
-
getDomainPart
Get emails domain part string.- Returns:
- Domain part string
-
getReverseDomainPart
Get emails reverse domain part string.- Returns:
- Reverse domain part string
-
getLocalPart
Get emails local part string.- Returns:
- Local part string
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this EMail. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "EMail[email=user@example.com]" -
compareTo
Compare with another object.- Specified by:
compareTo
in interfaceComparable<EMail>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-