Utility extensions, properties and useful methods to boost your programming with Kotlin.
Add the following repository to your pom.xml
:
<repositories>
<repository>
<id>central</id>
<url>http://34.210.110.148:8081/artifactory/libs-release</url>
</repository>
</repositories>
Add the following dependencies to your pom.xml
:
<dependencies>
<!-- KotlinExtensions -->
<dependency>
<groupId>me.carleslc</groupId>
<artifactId>kotlin-extensions</artifactId>
<version>0.4.2</version>
</dependency>
<!-- FunKTionale -->
<dependency>
<groupId>org.funktionale</groupId>
<artifactId>funktionale-all</artifactId>
<version>1.1</version>
</dependency>
<!-- Guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
</dependencies>
funKTionale and guava are optional dependencies, but they are very powerful to complement this library.
Add the following repository to your build.gradle
:
repositories {
url 'http://34.210.110.148:8081/artifactory/libs-release'
}
Add the following dependency to your build.gradle
:
dependencies {
compile 'me.carleslc:kotlin-extensions:0.4.2'
compile 'org.funktionale:funktionale-all:1.1'
compile 'com.google.guava:guava:22.0'
}
funKTionale and guava are optional dependencies, but they are very powerful to complement this library.
git clone https://github.com/Carleslc/kotlin-extensions.git
cd kotlin-extensions
- Build the KotlinExtensions with
mvn clean install
. This also adds this project to your local Maven repository. - Add the
kotlin-extensions-0.4.2.jar
fromtarget
folder as a dependency of your project.
If you wish you can use these steps to add the dependency using Maven without accessing to the remote repository.
In addition, if needed, you can add the dependencies of funKTionale and guava as they are very powerful to complement this library.
In order to use any of the extensions or methods of KotlinExtensions you only need to import them.
import me.carleslc.kotlin.extensions.standard.times
import me.carleslc.kotlin.extensions.standard.*
import me.carleslc.kotlin.extensions.arrays.*
Extensions for arrays, a syntactic-sugar way to create literal arrays like A[1, 2, 3]
instead typical arrayOf(1, 2, 3)
and methods to work with 2D arrays and matrices (2D arrays with fixed columns size) easier.
import me.carleslc.kotlin.extensions.bytes.*
Extensions for memory size conversions (from bits to pebibytes and petabytes).
Inspired from ktunits library.
import me.carleslc.kotlin.extensions.collections.*
Extensions for collections, sintactic-sugar for list and set literals with L[values]
or S[values]
and other global methods to create collections.
import me.carleslc.kotlin.extensions.conversions.*
Extensions for conversions between basic types.
import me.carleslc.kotlin.extensions.html.*
Extensions to generate HTML in a more readable way.
import me.carleslc.kotlin.extensions.map.*
Extensions for maps and sintactic-sugar for Map literals with `M[pairs].
import me.carleslc.kotlin.extensions.number.*
Extensions for numbers and math operations.
import me.carleslc.kotlin.extensions.strings.*
Extensions for strings.
import me.carleslc.kotlin.extensions.time.*
Extensions for timing, format and manage time or dates easily.
Inspired from kxdate and khronos libraries.
import me.carleslc.kotlin.extensions.tuples.*
Extensions for pairs and triples.
import me.carleslc.kotlin.extensions.standard.*
General purpose extensions and global methods that do not match any other package category (e.g. looping with 10 times { code }
or 10 * { code }
).
This library includes some functional extensions and classes like those of the common and most used functional languages.
import org.funktionale.collections.*
import org.funktionale.complement.*
import org.funktionale.composition.*
import org.funktionale.currying.*
import org.funktionale.either.*
import org.funktionale.memoization.*
import org.funktionale.option.*
import org.funktionale.pairing.*
import org.funktionale.partials.*
import org.funktionale.pipe.*
import org.funktionale.reverse.*
import org.funktionale.state.*
import org.funktionale.tries.*
import org.funktionale.utils.*
import org.funktionale.validation.*
This library from Google Developers includes a lot of useful classes and methods to extend the language. Is written in Java but we can use it from Kotlin with no problems.