-
Notifications
You must be signed in to change notification settings - Fork 6
Closed as not planned
Description
π Description
Similarly to the NotBlankString type, we would like to make the EmailAddress type comparable alphabetically by inheriting the Comparable interface.
interface EmailAddress : Comparable<EmailAddress> {
override fun compareTo(other: EmailAddress): Int
}Here's an example of comparing two email addresses from Kotlin code:
val first = EmailAddress.create("first@kotools.org")
val second = EmailAddress.create("second@kotools.org")
println(first < second) // trueHere's an example of comparing two email addresses from Java code:
final EmailAddress first = EmailAddress.Companion.create("first@kotools.org");
final EmailAddress second = EmailAddress.Companion.create("second@kotools.org");
System.out.println(first < second); // trueβ Checklist
- Make the type comparable, test its
compareTofunction on Kotlin and Java, update the public API binaries and the unreleased changelog. - Close this issue as completed and update tracking ones if present.