Coder Social home page Coder Social logo

carleslc / kotlin-extensions Goto Github PK

View Code? Open in Web Editor NEW
75.0 9.0 14.0 209 KB

Utility extensions to boost your programming with Kotlin.

License: MIT License

Kotlin 100.00%
kotlin conversion 2d-array boost gradle android html maven patterns utils

kotlin-extensions's Introduction

KotlinExtensions

Utility extensions, properties and useful methods to boost your programming with Kotlin.

ko-fi

How to install

Maven

Add the following repository to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add the following dependencies to your pom.xml:

<dependencies>
    <dependency>
    	<groupId>me.carleslc</groupId>
    	<artifactId>kotlin-extensions</artifactId>
    	<version>0.8</version>
    </dependency>
</dependencies>

If you need more powerful extensions and tools check the optional libraries section.

Gradle

Add the following repository to your build.gradle:

repositories {
    maven { url 'https://jitpack.io' }
}

Add the following dependency to your build.gradle:

dependencies {
    compile 'me.carleslc:kotlin-extensions:0.8'
}

If you need more powerful extensions and tools check the optional libraries section.

Manual

  1. git clone https://github.com/Carleslc/kotlin-extensions.git
  2. cd kotlin-extensions
  3. Build the KotlinExtensions with mvn clean install. This also adds this project to your local Maven repository.

If you wish, you can use these steps to add the dependency using Maven or Gradle without accessing to the jitpack.io remote repository.

Otherwise, you will need to add the kotlin-extensions-0.8.jar from generated target folder as external dependency of your project.

If you need more powerful extensions and tools check the optional libraries section.

How to use

In order to use any of the extensions or methods of KotlinExtensions you only need to import them.

Import a single extension

import main.kotlin.extensions.standard.times

Import all extensions of a package

import main.kotlin.extensions.standard.*

Packages available

Arrays

import main.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.

Bytes

import main.kotlin.extensions.bytes.*

Extensions for memory size conversions (from bits to pebibytes and petabytes).

Inspired from ktunits library.

Collections

import main.kotlin.extensions.collections.*

Extensions for collections, syntactic-sugar for list and set literals with L[values] or S[values] and other global methods to create collections.

Conversions

import main.kotlin.extensions.conversions.*

Extensions for conversions between basic types.

HTML

import main.kotlin.extensions.html.*

Extensions to generate HTML in a more readable way.

Map

import main.kotlin.extensions.map.*

Extensions for maps and sintactic-sugar for Map literals with M[pairs].

Number

import main.kotlin.extensions.number.*

Extensions for numbers and math operations.

Strings

import main.kotlin.extensions.strings.*

Extensions for strings.

pluralize and singularize methods are extracted from kotlin-pluralizer.

Time

import main.kotlin.extensions.time.*

Extensions for timing, format and manage time or dates easily.

Inspired from kxdate and khronos libraries.

Tuples

import main.kotlin.extensions.tuples.*

Extensions for pairs and triples.

Preconditions

import main.kotlin.extensions.preconditions.*

Extensions to ensure preconditions easily.

Standard

import main.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 }).

Contribute

Do you want to contribute to this project? Great!

Simply fork and do a pull request. Then if it makes sense I will merge it creating a new version of this project.

Follow this rules when doing a pull request in order to be accepted:

  1. Match the code style of this project (default in IntelliJ). You can do โŒ˜ + Option + L in Mac with IntelliJ IDE to reformat your code.
  2. Unit Test your code.
  3. Inline your extensions when possible. Include @file:Suppress("NOTHING_TO_INLINE") to suppress warnings at top of your file.
  4. Ensure that your extensions/methods are general enough to be used in many different contexts.
  5. Be descriptive in the title and description of your pull request.

Optional Libraries

This library adds functional stuff to boost your programming with Kotlin. It is a perfect library to use together with KotlinExtensions.

We've already included arrow.core in KotlinExtensions.

This library from Google includes a lot of useful classes and methods to extend the language. It is written in Java but it can be used from Kotlin with no problem.

It is already included with version 32.0.0-android in KotlinExtensions, available for Android use.

If you need extensions and useful tools for Android these libraries are recommended for your Android development.

kotlin-extensions's People

Contributors

carleslc avatar dependabot[bot] avatar juzerali avatar pvs1209pvs avatar stangls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kotlin-extensions's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.