Utility extensions, properties and useful methods to boost your programming with Kotlin.
First steps:
git clone https://github.com/Carleslc/KotlinExtensions.git
cd KotlinExtensions
- Build the KotlinExtensions with
mvn clean install
to add this project to your local Maven repository.
Then you can add KotlinExtensions to your project:
Add the following dependency to your pom.xml
<dependency>
<groupId>me.carleslc.kotlinextensions</groupId>
<artifactId>KotlinExtensions</artifactId>
<version>0.1</version>
<scope>compile</scope>
</dependency>
Add the KotlinExtensions-0.1.jar
from target
folder as a dependency of your project.
In order to use any of the extensions or methods of KotlinExtensions you only need to import them.
import me.carleslc.extensions.number.even
import me.carleslc.extensions.number.*
Extensions for Any objects.
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.
Extensions for collections and other static methods to create collections.
Extensions for lambda functions and other static methods to work with functions (e.g. function composition).
Extensions to generate HTML in a more readable way.
Extensions for maps.
Extensions for numbers and conversions.
Static methods to format time easily.
Extensions for tuples (pairs).
General purpose extensions and static methods that do not match any other package category (e.g. loops with Int.times
).