Skip to content

Releases: kotools/types

4.5.1

28 Apr 14:58
4.5.1
5df10f4
Compare
Choose a tag to compare

✨ 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. 🙏

4.5.0

14 Mar 10:30
4.5.0
f929061
Compare
Choose a tag to compare

✨ Added

  • Support macOS arm64 systems with Kotlin Native (#414).
  • The StrictlyNegativeDouble experimental type for representing a floating-point number of type Double that is less than zero (#555).
  • The create(Any?) and the createOrNull(Any?) experimental factory functions in NotBlankString.Companion (#341).
  • The create(Number) and createOrNull(Number) experimental factory functions in the following types:
    • StrictlyPositiveInt.Companion (#342)
    • StrictlyNegativeInt.Companion (#347)
    • PositiveInt.Companion (#349)
    • NegativeInt.Companion (#350)
    • NonZeroInt.Companion (#351).
  • The create(Collection<E>), the createOrNull(Collection<E>) and the of(E, vararg E) experimental factory functions in NotEmptyList.Companion (#352) and in NotEmptySet.Companion (#353).
  • The create(Map<K, V>), the createOrNull(Map<K, V>) and the of(Pair<K, V>, vararg Pair<K, V>) experimental factory functions in NotEmptyMap.Companion (#354).
  • The NotBlankString.plus(Any) experimental operation (#543).
  • Documentation of dependency compatibility (#288).
  • The documentation of the serialization and the deserialization processes in the API reference for the following types: AnyInt, NonZeroInt, PositiveInt, NegativeInt, StrictlyPositiveInt, StrictlyNegativeInt, ZeroInt, NotBlankString, NotEmptyList, NotEmptySet and NotEmptyMap (#256).
  • References to the corresponding factory functions for eligible types in the API reference (cfc99b2).
  • Tagline suggested by @jmfayard in the README documentation (#338).

♻️ Changed

  • Bump embedded Kotlin from 1.7.21 to 1.8.22 (#172 and #196).
  • Bump kotlinx.serialization from 1.4.0 to 1.5.1 (#378 and #381).
  • Move the EmailAddress experimental type from the kotools.types.experimental package to the new kotools.types.web one (#377).
  • Make the regex property of the EmailAddress experimental type inaccessible for Java sources, due to the unavailability of the kotlin.text.Regex type for this language (8d0d098).
  • Update the regular expression of the EmailAddress experimental type for following the RFC-5322 (#394).
  • Update our Git commit messages convention using Gitmoji in our Contribution Guidelines (#490).

🗑️ Deprecated

Deprecation promotion of the following annotations to error (#333):

  • ExperimentalCollectionApi
  • ExperimentalNumberApi
  • ExperimentalRangeApi
  • ExperimentalResultApi
  • ExperimentalTextApi

🔥 Removed

The plus experimental operations using the NotBlankString type (#542).


Thanks to @jmfayard and @LVMVRQUXL for contributing to this new release. 🙏

4.4.2

07 Feb 18:06
4.4.2
a820079
Compare
Choose a tag to compare

🐛 Fixed

Serialization problems using the Kotlin/JS IR compiler for all serializable types (#431).


Thanks to @robertfmurdock and @LVMVRQUXL for contributing to this new release. 🙏

4.4.1

02 Feb 04:12
4.4.1
90388ad
Compare
Choose a tag to compare

🐛 Fixed

The types-internal subproject was missing in the Gradle dependency tree of Kotools Types 4.4.0 (#406).


Thanks to @robertfmurdock and @LVMVRQUXL for contributing to this new release. 🙏

4.4.0

29 Jan 09:37
4.4.0
ac3a46d
Compare
Choose a tag to compare

Important

Due to a packaging error in this version, reported by @robertfmurdock in issue #406, users should upgrade directly to version 4.4.1.

✨ Added

  • EmailAddress experimental type, suggested by @MichaelStH in #55, for representing an email address (#339).
  • AnyInt(Int) experimental factory function (571428b).
  • Companion object for the following experimental types: InclusiveBound (a8aedb4), ExclusiveBound (76ba063), NotEmptyRange (a4399cc) and NotEmptyRange.BuilderScope (79e093c).
  • ExperimentalKotoolsTypesApi annotation for marking experimental declarations (#191).
  • Security policy indicating which versions are supported with security updates and how to report a security vulnerability (#250).
  • Documentation of versioning strategy and declarations lifecycle (#215 and #307).
  • Versions 4.1.0, 4.0.1, 4.0.0, 3.2.0, 2.0.0 and 1.3.1 in API reference (#261).

♻️ Changed

  • Move the following experimental declarations to the kotools.types.experimental package with a new signature (#319):
    • StrictlyPositiveDouble type
    • unaryMinus operation on AnyInt, NonZeroInt, PositiveInt, NegativeInt, StrictlyPositiveInt and StrictlyNegativeInt
    • Bound, InclusiveBound and ExclusiveBound types with their declarations
    • NotEmptyRange type with its declarations
    • plus(String), plus(NotBlankString) and plus(Char) operations on NotBlankString
    • Char.plus(NotBlankString) operation
    • range property for companion object of PositiveInt, NegativeInt, StrictlyPositiveInt and StrictlyNegativeInt
    • positiveRange and negativeRange properties on NonZeroInt.Companion.
  • Opt-in message of experimental annotations (#328).
  • Documentation of types in API reference and in README (ed9322d).
  • Align styles of version 4.2.0 with the latest ones in API reference (#261).

🗑️ Deprecated

ExperimentalCollectionApi, ExperimentalNumberApi, ExperimentalRangeApi, ExperimentalResultApi and ExperimentalTextApi annotations (#327).

🔥 Removed

  • The following experimental factory functions (#258):
    • toNonZeroIntOrNull and toNonZeroIntOrThrow
    • toPositiveIntOrNull and toPositiveIntOrThrow
    • toNegativeIntOrNull and toNegativeIntOrThrow
    • toStrictlyPositiveIntOrNull and toStrictlyPositiveIntOrThrow
    • toStrictlyNegativeIntOrNull and toStrictlyNegativeIntOrThrow
    • toStrictlyPositiveDoubleOrNull and toStrictlyPositiveDoubleOrThrow
    • toNotBlankStringOrNull and toNotBlankStringOrThrow
    • toNotEmptyListOrNull and toNotEmptyListOrThrow
    • toNotEmptySetOrNull and toNotEmptySetOrThrow
    • toNotEmptyMapOrNull and toNotEmptyMapOrThrow.
  • The Result.flatMap experimental function (#125).
  • The Number.toStrictlyPositiveDouble experimental function in ResultContext (5ef8aa0).
  • The ExperimentalSinceKotoolsTypes and the SinceKotoolsTypes internal annotations (9052e77 and 557350b).

🐛 Fixed

The copyright notice in the license (#257).

🔒 Security

  • Hide all internals from Java users (#303).
  • Upgrade to Webpack 5.76.3 for avoiding cross-realm object access on Kotlin/JS (#313).

Thanks to @MichaelStH and @LVMVRQUXL for contributing to this new release. 🙏

4.3.1

25 Sep 20:41
4.3.1
1025243
Compare
Choose a tag to compare

✨ Added

  • ExperimentalCollectionApi annotation for marking experimental declarations of the kotools.types.collection package (#177).
  • Experimental type converters suffixed by OrNull and OrThrow for the following types: NonZeroInt (#173), PositiveInt (#155), NegativeInt (#171), StrictlyPositiveInt (#141), StrictlyNegativeInt (#167), StrictlyPositiveDouble (#132), NotBlankString (#174), NotEmptyList (#176), NotEmptySet (#178) and NotEmptyMap (#179).

♻️ Changed

  • Source compatibility with Kotlin improved by supporting its versions 1.5 through 1.7 (#213).
  • Support multiple versions in the API reference starting from version 4.2.0 (#198 and #205).

🐛 Fixed

Typo in the documentation of the notEmptyRangeOf function (#222).


Thanks to @o-korpi and @LVMVRQUXL for contributing to this new release. 🙏

4.3.0

14 Aug 16:08
4.3.0
e131471
Compare
Choose a tag to compare

♻️ Changed


Thanks to @LVMVRQUXL for contributing to this new release. 🙏

4.2.0

24 Jun 21:52
4.2.0
16deaa1
Compare
Choose a tag to compare

Important

Starting from this version, this library is now published under the org.kotools group.
This change in mind, here's an example of upgrading Kotools Types from 4.1.0 to 4.2.0 using the Kotlin DSL in Gradle:

// before
implementation("io.github.kotools:types:4.1.0")
// after
implementation("org.kotools:types:4.2.0")

✨ Added

  • The NotEmptyRange and the Bound experimental types representing a range of comparable values that contain at least one value (#56).
  • The StrictlyPositiveDouble experimental type representing strictly positive floating-point numbers represented by the Double type (#66).
  • The plus experimental operations for concatenating a NotBlankString with a String or a Char (#53).
  • The Result.flatMap experimental operation for transforming its encapsulated value (#47).
  • The unaryMinus experimental operations for returning the negative of an AnyInt (#105).

♻️ Changed

🗑️ Deprecated

The collections declared as data classes will be converted to classes (or inline value classes when possible) in version 4.3.0, which means that their copy function is deprecated and will be unavailable after their conversion (#97).


Thanks to @MichaelStH and @LVMVRQUXL for contributing to this new release. 🙏

4.1.0

03 Apr 08:02
4.1.0
fb213da
Compare
Choose a tag to compare

✨ Added

  • NotEmptyCollection hierarchy representing collections that contain at least one element (#14).
  • Binary operations (plus, minus, times, div and rem) for the AnyInt hierarchy (#31).
  • resultOf function for encapsulating computations of functions returning the Result type (#37).

♻️ Changed

  • Support for Kotlin 1.5.32 (#6).
  • The following builders now works on the Number type instead of the Int type only: toNonZeroInt, toPositiveInt, toNegativeInt, toStrictlyPositiveInt and toStrictlyNegativeInt (#43).
  • The AnyInt and the NotBlankString types are now inheriting from Comparable (#45).

Thanks to @LVMVRQUXL for contributing to this new release. 🙏

4.0.1

06 Feb 15:51
4.0.1
2858141
Compare
Choose a tag to compare

♻️ Changed

Update documentation of declarations returning the Result type (#20).

🐛 Fixed

Fix versioning annotation of declarations in the kotools.types.number package (#23).


Thanks to @LVMVRQUXL for contributing to this new release. 🙏