• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Carleslc/kotlin-extensions: Utility extensions to boost your programming with Ko ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Carleslc/kotlin-extensions

开源软件地址(OpenSource Url):

https://github.com/Carleslc/kotlin-extensions

开源编程语言(OpenSource Language):

Kotlin 100.0%

开源软件介绍(OpenSource 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>com.github.carleslc</groupId>
    	<artifactId>kotlin-extensions</artifactId>
    	<version>0.7.6</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 'com.github.carleslc:kotlin-extensions:0.7.6'
}

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.7.6.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 me.carleslc.kotlin.extensions.standard.times

Import all extensions of a package

import me.carleslc.kotlin.extensions.standard.*

Packages available

Arrays

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.

Bytes

import me.carleslc.kotlin.extensions.bytes.*

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

Inspired from ktunits library.

Collections

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.

Conversions

import me.carleslc.kotlin.extensions.conversions.*

Extensions for conversions between basic types.

HTML

import me.carleslc.kotlin.extensions.html.*

Extensions to generate HTML in a more readable way.

Map

import me.carleslc.kotlin.extensions.map.*

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

Number

import me.carleslc.kotlin.extensions.number.*

Extensions for numbers and math operations.

Strings

import me.carleslc.kotlin.extensions.strings.*

Extensions for strings.

pluralize and singularize methods are extracted from kotlin-pluralizer.

Time

import me.carleslc.kotlin.extensions.time.*

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

Inspired from kxdate and khronos libraries.

Tuples

import me.carleslc.kotlin.extensions.tuples.*

Extensions for pairs and triples.

Preconditions

import me.carleslc.kotlin.extensions.preconditions.*

Extensions to ensure preconditions easily.

Standard

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

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

Arrow

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, arrow.data and arrow.syntax in KotlinExtensions.

Guava

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 23.3-android in KotlinExtensions, available for Android use.

Anko

If you need extensions and useful tools for Android this library is a must for your Android development.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap