Kotools Types - a lightweight library that provides commonly used types for Kotlin

Related tags

Kotlin types
Overview

Kotools Types

Maven Central Kotlin

Kotools Types is a lightweight library that provides commonly used types for Kotlin.

1.nonZero
1.nonZeroOrNull

(-1).strictlyNegative
(-1).strictlyNegativeOrNull

1.strictlyPositive
1.strictlyPositiveOrNull

"hello".notBlank
"hello".notBlankOrNull

Installation

Gradle

Kotlin DSL

testImplementation("io.github.kotools:types:1.0.0")

Groovy DSL

testImplementation 'io.github.kotools:types:1.0.0'

Maven

<dependency>
    <groupId>io.github.kotoolsgroupId>
    <artifactId>typesartifactId>
    <version>1.0.0version>
dependency>

Documentation

Latest documentation of Kotools Types is available here.

Contributing

Feel free to contribute to the project with issues and pull requests.

License

This project is licensed under the MIT License.

Comments
  • `NotEmptySet` type inheritance

    `NotEmptySet` type inheritance

    Description

    Update the implementation of the NotEmptySet type for not inheriting from a type like the following:

    data class NotEmptySet<A>(val head: A, val tail: NotEmptySet<A>? = null) {
        val asSet: Set<A> get() = TODO()
        val size: StrictlyPositiveInt get() = TODO()
    }
    

    Checklist

    • [x] Implement.
    • [x] Test.
    • [x] Refactor.
    • [x] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 1
  • `NotEmptyList` type inheritance

    `NotEmptyList` type inheritance

    Description

    Update the implementation of the NotEmptyList for not inheriting from a type like the following:

    data class NotEmptyList<E>(val head: E, val tail: NotEmptyList<E>? = null) {
        val asList: List<E> get() = TODO()
        val size: StrictlyPositiveInt get() = TODO()
    }
    

    Checklist

    • [x] Implement.
    • [x] Test.
    • [x] Refactor.
    • [x] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 1
  • Min, max and random for integers

    Min, max and random for integers

    Description

    Implement the following operations in the companion object of integers:

    • the min property holding the minimum value of the integer type
    • the max property holding the maximum value of the integer type
    • the random function returning a random integer type.

    Checklist

    • [x] Implement for NonZeroInt.
    • [x] Implement for PositiveInt.
    • [x] Implement for NegativeInt.
    • [x] Implement for StrictlyPositiveInt.
    • [x] Implement for StrictlyNegativeInt.
    • [x] Test.
    • [x] Refactor.
    enhancement common 
    opened by LVMVRQUXL 0
  • Conversions alignement for integers

    Conversions alignement for integers

    Description

    Convert the builder of integers to a property, and rename their value property to asInt. Here's an example for the NonZeroInt type:

    // Before
    val NonZeroInt.value: Int get() = TODO()
    fun Int.toNonZeroInt(): Result<NonZeroInt> = TODO()
    
    // After
    val Int.asNonZeroInt: Result<NonZeroInt> get() = TODO()
    val NonZeroInt.asInt: Int get() = TODO()
    

    Checklist

    • [x] Implement.
    • [x] Test.
    • [x] Refactor.
    enhancement common 
    opened by LVMVRQUXL 0
  • Conversions alignement for `NotBlankString`

    Conversions alignement for `NotBlankString`

    Description

    Replace the toNotBlankString function by the asNotBlankString property, and make the value property private.

    // Before
    val NotBlankString.value: String get() = TODO()
    fun String.toNotBlankString(): Result<NotBlankString> = TODO()
    fun NotBlankString.toString(): String = TODO()
    
    // After
    val String.asNotBlankString: Result<NotBlankString> get() = TODO()
    fun NotBlankString.toString(): String = TODO()
    

    Checklist

    • [x] Implement.
    • [x] Test.
    • [x] Refactor.
    enhancement common 
    opened by LVMVRQUXL 0
  • `NotEmptyMap` type inheritance

    `NotEmptyMap` type inheritance

    Description

    Update the implementation of the NotEmptyMap type for not inheriting from any type like the following:

    data class NotEmptyMap<K, V>(val head: Pair<K, V>, val tail: NotEmptyMap<K, V>? = null) {
        val asMap: Map<K, V> get() = TODO()
        val entries: NotEmptySet<Map.Entry<K, V>> get() = TODO()
        val keys: NotEmptySet<K> get() = TODO()
        val values: NotEmptyList<V> get() = TODO()
        val size: StrictlyPositiveInt get() = TODO()
    }
    

    Checklist

    • [x] Implement.
    • [x] Test.
    • [x] Refactor.
    • [x] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 0
  • `NotBlankString` and `CharSequence`

    `NotBlankString` and `CharSequence`

    Description

    Make the NotBlankString type implementing the CharSequence interface.

    This issue can introduce breaking changes!

    Checklist

    • [ ] Implement.
    • [ ] Test.
    • [ ] Refactor.
    • [ ] Update Work in progress section in changelog.
    enhancement wontfix common 
    opened by LVMVRQUXL 0
  • New `NotEmptyCollection` type

    New `NotEmptyCollection` type

    Description

    Introduce a new NotEmptyCollection type representing collections that contain at least one element:

    /** Representation of collections containing at least one element of type [E]. */
    sealed interface NotEmptyCollection<out E> {
        /** The first element of this collection. */
        val head: E
        
        /** The size of this collection. */
        val size: StrictlyPositiveInt
        
        /** Returns the string representation of this collection. */
        override fun toString(): String
    }
    
    data class NotEmptyList<out E> : NotEmptyCollection<E> { /* ... */ }
    data class NotEmptySet<out E> : NotEmptyCollection<E> { /* ... */ }
    

    Checklist

    • [ ] Implement.
    • [ ] Test.
    • [ ] Refactor.
    • [ ] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 0
  • Release version 4.1.0

    Release version 4.1.0

    Dependencies

    Issues of this new version should be done before resolving this issue.

    Checklist

    • [ ] Upgrade the application's version.
    • [ ] Add a new version in changelog.
    • [ ] Create a release on the repository.
    release 
    opened by LVMVRQUXL 0
  • Kotlin 1.5.32

    Kotlin 1.5.32

    Description

    Use Kotlin 1.5.32 in this project.

    Checklist

    • [ ] Upgrade Kotlin.
    • [ ] Test.
    • [ ] Refactor.
    • [ ] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 0
  • Concatenation of `NotBlankString` with another one

    Concatenation of `NotBlankString` with another one

    Description

    For concatenating a NotBlankString with another one easily, we should implement the following functions:

    operator fun NotBlankString.plus(other: NotBlankString): NotBlankString = TODO()
    operator fun NotBlankString.plus(other: Result<NotBlankString>): Result<NotBlankString> = TODO()
    operator fun Result<NotBlankString>.plus(other: NotBlankString): Result<NotBlankString> = TODO()
    operator fun Result<NotBlankString>.plus(other: Result<NotBlankString>): Result<NotBlankString> = TODO()
    
    fun main(): Unit = println("hello".toNotBlankString() + " world".toNotBlankString()) // Success(hello world)
    

    Checklist

    • [ ] Implement the NotBlankString.plus(NotBlankString) function.
    • [ ] Implement the NotBlankString.plus(Result<NotBlankString>) function.
    • [ ] Implement the Result<NotBlankString>.plus(NotBlankString) function.
    • [ ] Implement the Result<NotBlankString>.plus(Result<NotBlankString>) function.
    • [ ] Refactor.
    • [ ] Update Work in progress section in changelog.
    enhancement common 
    opened by LVMVRQUXL 0
  • Release version 4.0.0

    Release version 4.0.0

    Dependencies

    Issues of this new version should be done before resolving this issue.

    Checklist

    • [x] Upgrade the application's version.
    • [x] Add a new version in changelog.
    • [ ] Release on the Maven Central.
    • [ ] Update version in readme.
    • [ ] Create a release on the repository.
    release 
    opened by LVMVRQUXL 0
Releases(v3.1.0)
Owner
Kotools
Libraries for elegant programming with Kotlin.
Kotools
AbstractMvp 0.8 0.0 Kotlin is a library that provides abstract components for MVP architecture realization, with problems solutions that are exist in classic MVP.

MinSDK 14+ AbstractMvp AbstractMvp is a library that provides abstract components for MVP architecture realization, with problems solutions that are e

Robert 12 Apr 5, 2022
An Android Library that provides social login for 15 platforms within by RxJava2, Kotlin and Firebase Authentication.

RxSocialLogin The license information for logo is located at the bottom of the document. These instructions are available in their respective language

WindSekirun (wind.seo) 124 Nov 21, 2022
A library provides some useful kotlin extension functions

ktext ?? A library provides some useful kotlin extension functions. Including in your project Gradle Add below codes to your root build.gradle file (n

热心市民苏苏仔 76 Oct 26, 2022
A lightweight cache library written in Kotlin

[NEW] Released to Maven Central: 'com.github.yundom:kache:1.x.x' Kache A runtime in-memory cache. Installation Put this in your build.gradle implemen

Dennis 22 Nov 19, 2022
Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties

Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties Idea Delegated properties in Kotlin allow you to execute a

null 25 Dec 27, 2022
Koi, a lightweight kotlin library for Android Development.

Koi - A lightweight Kotlin library for Android Koi include many useful extensions and functions, they can help reducing the boilerplate code in Androi

Hello World 514 Nov 29, 2022
🚟 Lightweight, and simple scheduling library made for Kotlin (JVM)

Haru ?? Lightweight, and simple scheduling library made for Kotlin (JVM) Why did you build this? I built this library as a personal usage library to h

Noel 13 Dec 16, 2022
Lightweight Kotlin DSL dependency injection library

Warehouse DSL Warehouse is a lightweight Kotlin DSL dependency injection library this library has an extremely faster learning curve and more human fr

Osama Raddad 18 Jul 17, 2022
A lightweight and simple Kotlin library for deep link handling on Android 🔗.

A lightweight and simple Kotlin library for deep link handling on Android ??.

Jeziel Lago 101 Aug 14, 2022
A fast, lightweight, entity component system library written in Kotlin.

Fleks A fast, lightweight, entity component system library written in Kotlin. Motivation When developing my hobby games using LibGDX, I always used As

Simon 66 Dec 28, 2022
Lightweight compiler plugin intended for Kotlin/JVM library development and symbol visibility control.

Restrikt A Kotlin/JVM compiler plugin to restrict symbols access, from external project sources. This plugin offers two ways to hide symbols: An autom

Lorris Creantor 18 Nov 24, 2022
Provides Kotlin libs and some features for building Kotlin plugins

Kotlin Plugin Provides Kotlin libs and some features for building awesome Kotlin plugins. Can be used instead of CreeperFace's KotlinLib (don't use to

null 3 Dec 24, 2021
Android calendar library provides easy to use widget with events

Kotlin-AgendaCalendarView Kotlin-AgendaCalendarView based on AgendaCalendarView Kotlin-AgendaCalendarView is a awesome calendar widget with a list of

Ognev Zair 88 Nov 21, 2022
Clay is an Android library project that provides image trimming which is originally an UI component of LINE Creators Studio

Clay Clay is an Android library project that provides image trimming. Fully written in Kotlin, Clay is originally a UI component of LINE Creators Stud

LINE 119 Dec 27, 2022
Simple Android Library, that provides easy way to start the Activities with arguments.

Warning: Library is not maintained anymore. If you want to take care of this library, propose it via Pull Request. It needs adjustmensts for newer ver

Marcin Moskała 429 Dec 15, 2022
Kamper - a small KMM/KMP library that provides performance monitoring for your app.

?? Kamper Kamper is a KMP/KMM library that implements a unified way to track application performances. The solution is based on plugin design patterns

S. Mellouk 31 Jun 10, 2022
This library provides common speech features for ASR including MFCCs and filterbank energies for Android and iOS.

Kotlin Speech Features Quick Links ?? Introduction This library is a complete port of python_speech_features in pure Kotlin available for Android and

Merlyn Mind 13 Oct 7, 2022
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

Rajat 362 Dec 29, 2022
Lightweight data loading and caching library for android

ColdStorage A lightweight data loading and caching library for android Quicklinks Feature requests: Got a new requirement? Request it here and it will

Cryptic Minds 41 Oct 17, 2022