✨ Added
- Introduced the
Zero
experimental type representing the zero number in the neworg.kotools.types
package (#644). This package will contain reimplemented types and those from thekotools.types.*
packages will be deprecated incrementally. - Introduced the
EmailAddress
experimental type representing email addresses in theorg.kotools.types
package (#635). This new implementation provides newfromString
andfromStringOrNull
factory functions accepting avalue
argument of typeAny
. For simplicity purpose, the default pattern used for validating email addresses is^\S+@\S+\.\S+$
, which allows a wider range of values. But it is also possible to provide apattern
argument of typeAny
to these new factory functions for customizing the validation.
val value: Any = "contact@kotools.org"
val pattern: Any = "^[a-z]+@[a-z]+\\.[a-z]+\$"
val result: Result<EmailAddress> = kotlin.runCatching {
EmailAddress.fromString(value, pattern)
}
println(result.isSuccess) // true
- New
types-kotlinx-serialization
module for supporting serialization of types from theorg.kotools.types
package using the Kotlin Serialization library (#602). See its README documentation for more details on how to use it.
♻️ Changed
- Our versioning strategy is now based on backward compatibility, focusing on behavioral, source and binary compatibilities.
- The
create
and thecreateOrNull
experimental functions of theNotBlankString.Companion
type now accept a value of typeAny
instead ofAny?
(#626).
// Before
NotBlankString.create(null) // pass
NotBlankString.createOrNull(null) // pass
// Now
NotBlankString.create(null) // compilation error
NotBlankString.createOrNull(null) // compilation error
- The documentation of the
AnyInt(Int)
experimental constructor-like function now uses collapsing sections for splitting Kotlin and Java samples (8eb8044).
🗑️ Deprecated
- The following annotations are now hidden from sources (#334):
ExperimentalCollectionApi
,ExperimentalNumberApi
,ExperimentalRangeApi
,ExperimentalResultApi
andExperimentalTextApi
. - The
EmailAddress
experimental type from thekotools.types.web
package is now deprecated with a warning level for using the corresponding type from theorg.kotools.types
package (#635). Itscreate
andcreateOrNull
factory functions are also deprecated with an error level for this reason.
🔥 Removed
Due to an internal compilation error of Kotlin when comparing generics, the following types have been removed from the experimental API: NotEmptyRange
, Bound
, InclusiveBound
and ExclusiveBound
(#627). Experimental properties using these types were also removed.
Thanks to @augustomtt and @LVMVRQUXL for contributing to this new release. 🙏