This project is not maintained anymore. Please find the libraries in their respective repository.
This project contains a set of libraries providing tools for expressive programming in Kotlin.
Versions 1, 2 and 3 are not maintained anymore. Please find the new one in this repository.
Kotools Types provides explicit types like NonZeroInt
or NotBlankString
for
the following platforms: JVM, JS, Linux x64, macOS x64 and Windows x64.
import kotools.types.number.StrictlyPositiveInt
import kotools.types.number.toStrictlyPositiveInt
import kotools.types.text.NotBlankString
import kotools.types.text.toNotBlankString
data class Person(val name: NotBlankString, val age: StrictlyPositiveInt)
fun main() {
val name: NotBlankString = "Somebody".toNotBlankString()
.getOrThrow()
val age: StrictlyPositiveInt = 42.toStrictlyPositiveInt()
.getOrThrow()
val somebody = Person(name, age)
println(somebody) // Person(name=Somebody, age=42)
}
Kotools CSV is a JVM library for managing CSV files an expressive DSL.
data class Person(val name: String, val age: Int, val isAdmin: Boolean = false)
suspend fun main() {
csvWriter<Person> {
file = "people"
records { +Person("Nobody", 25) }
}
val people: List<Person> = csvReader { file = "people" }
println(people)
}
Kotools Assert provides additional assertions for the following platforms: JVM, JS, Linux x64, macOS x64 and Windows x64.
1 assertEquals 1
2 assertNotEquals 0
assertNull { null }
null.assertNull()
assertNotNull { 3 }
3.assertNotNull()
assertPass { println("Hello") }
assertFails { throw Exception() }
assertFailsWith<RuntimeException> { throw RuntimeException() }
implementation("io.github.kotools:csv:2.2.1")
implementation("io.github.kotools:types:3.2.0")
testImplementation("io.github.kotools:assert:3.0.2")
implementation "io.github.kotools:csv:2.2.1"
implementation "io.github.kotools:types:3.2.0"
testImplementation "io.github.kotools:assert:3.0.2"
<dependencies>
<dependency>
<groupId>io.github.kotools</groupId>
<artifactId>csv</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>io.github.kotools</groupId>
<artifactId>types</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>io.github.kotools</groupId>
<artifactId>assert</artifactId>
<version>3.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Latest documentation of those libraries is available here.
Feel free to contribute to this project with issues and pull requests.
This project follows the Conventional Commits guidelines for committing with Git. Please read the specifications before committing to this project.
All libraries are licensed under the MIT License.