This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
Releases: kotools/libraries
Releases · kotools/libraries
Kotools Types v4.0.0-beta
All platforms
Added
- Hierarchy of
AnyInt
representing integers (#132). - The
length
property to theNotBlankString
type (#143).
Changed
- Move the
NotBlankString
type to thekotools.types.text
package (#133). - Move the following types to the
kotools.types.collection
package:NotEmptyList
,NotEmptySet
andNotEmpty
(#138).
Removed
Deprecated declarations from version 3 (#37).
Kotools Types v3.2.0
All platforms
Added
- Explicit builders for all types (#22).
- Types in the
kotools.types
package:
Changed
- Update random API for getting a random
IntHolder
(#17). - Replace the
SinceKotoolsTypes
annotation by theSinceKotools
shared annotation (#54).
Deprecated
- The
random
function in the companion object ofIntHolder
's subtypes (#17). - Builders throwing an exception without having the
OrThrow
suffix in their name (#22). - Builders having an invalid name, like
PositiveIntOrNull
(#22). ConstructionError
objects (#22).- The DSL in alpha stage for building numbers (#33).
- The
NotBlankString
type from thekotools.types.string
package (#103). - The following types from the
kotools.types.number
package: - The following types from the
kotools.types.collections
package:
Kotools Types v3.1.1
Kotools Types v3.2.0-alpha.1
Kotools CSV v2.2.1
Kotools CSV v2.1.2
Fixed
Fix pagination and filter ordering in the reader: the filter is now applied before the pagination (#8).
Kotools CSV v2.0.2
Fixed
Add missing csvWriterAsync
function (#6).
Kotools Types v3.1.0
All platforms
Added
NotEmptyMap
type representing maps that contain at least one entry (#120).
Changed
- Convert the following types from a class to a sealed interface:
- Promote all deprecations of version 3.0 (#119).
- Stabilize the random API for getting an instance of
IntHolder
with a random value (#118). - The DSL for building numbers is now available in alpha stage in the
kotools.types.number
package (#130).
Kotools Types v3.0.1
Kotools Types v3.0.0
All platforms
Added
- Support for the JVM, JS and Native platforms using Kotlin Multiplatform (#62).
- Serialization and deserialization with kotlinx.serialization of
NonZeroInt
,PositiveInt
,StrictlyPositiveInt
,NegativeInt
,StrictlyNegativeInt
,NotBlankString
,NotEmptyList
andNotEmptySet
(#65). - Beta API for getting an instance of
IntHolder
with a random value.
val x = PositiveInt.random()
val y = PositiveInt.random()
x.value == y.value // false
- Experimental DSL for building numbers according to the given context. Here's an example with the
nonZero
context:
nonZero int 1 // NonZeroInt(value = 1)
nonZero int 0 // throws an exception
nonZero intOrNull -1 // NonZeroInt(value = -1)
nonZero intOrNull 0 // null
Changed
- Update type system for integers with a new
IntHolder
type (#112).
- Builders of
NotEmptyList
andNotEmptySet
now work without reifying types (#68). - Improve error management (#70).
Deprecated
// Instead of doing...
NonZeroInt orNull 1
NotBlankString orNull "hello world"
// do this
NonZeroIntOrNull(1)
NotBlankStringOrNull("hello world")
- Constructor of
NotEmptyList
andNotEmptySet
.
// Instead of doing...
NotEmptyList<Int>(1, 2, 3)
NotEmptySet<Int>(4, 5, 6)
// do this
notEmptyListOf<Int>(1, 2, 3)
notEmptySetOf<Int>(4, 5, 6)
- Positional access operations of
NotEmptyCollection
receiving an index of typeInt
.
val list = notEmptyListOf(1, 2, 3)
// Instead of doing...
list[1]
// do this
list[PositiveInt(1)] // or list[StrictlyPositiveInt(1)]
Removed
NotEmptyMutableList
andNotEmptyMutableSet
: mutable collections can be empty by definition.- Conversions from subtypes of
IntHolder
.