Skip to content

4.5.1

Latest
Compare
Choose a tag to compare
@LVMVRQUXL LVMVRQUXL released this 28 Apr 14:58
· 170 commits to main since this release
4.5.1
5df10f4

✨ Added

  • Introduced the Zero experimental type representing the zero number in the new org.kotools.types package (#644). This package will contain reimplemented types and those from the kotools.types.* packages will be deprecated incrementally.
  • Introduced the EmailAddress experimental type representing email addresses in the org.kotools.types package (#635). This new implementation provides new fromString and fromStringOrNull factory functions accepting a value argument of type Any. 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 a pattern argument of type Any 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 the org.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 the createOrNull experimental functions of the NotBlankString.Companion type now accept a value of type Any instead of Any? (#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 and ExperimentalTextApi.
  • The EmailAddress experimental type from the kotools.types.web package is now deprecated with a warning level for using the corresponding type from the org.kotools.types package (#635). Its create and createOrNull 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. 🙏