Random small libraries, usually extensions making other libraries happier.
Please send contributions, fork the repo, issue a pull request and write a comment in the pull request granting the rights for the code to be used in Klutter.
Each module has its own set of dependencies. There is a main dependency which is always the most current JDK version of the module, and also a version suffixed by the JDK version for which it is compatible (that version or newer). Include the dependency in your Gradle / Maven projects, ones that already have Kotlin configured.
For example, for the whole package (one of klutter-all
(lastest JDK), klutter-all-jdk6
, klutter-all-jdk7
, or klutter-all-jdk8
) and using an
open-ended dependency number while Klutter is in early active development:
Gradle:
compile "uy.klutter:klutter-all:1.15.+"
Maven:
<dependency>
<groupId>uy.klutter</groupId>
<artifactId>klutter-all</artifactId>
<version>[1.15.0,1.16.0)</version>
</dependency>
See all modules and current versions on Maven Central search (or the raw repo)
Maven‑Artifact | Size | Topic | Injekt |
---|---|---|---|
aws-s3 | tiny | Amazon AWS SDK S3 helper extensions | Yes |
aws-core | tiny | Amazon AWS SDK helper extensions | No |
config-typesafe | medium | Typesafe Config easier loader and access to configuration | No |
core | small | Core extension methods on strings, numbers, dates, URI Builder, better URL Encoding/Decoding | No |
db-jdbi-v2 | small | Adds Kotlin parameter binding and RestulSet mapping to JDBI versions 2.x | No |
db-jdbi-v3 | small | Adds Kotlin parameter binding and RestulSet mapping to JDBI versions 3.x | No |
elasticsearch | medium | Extensions to ElasticSearch client library | No |
json-jackson | tiny | Jackson JSON Data Binding extensions + loading of Kotlin module | Yes |
netflix-graph | medium | In memory graph building and compression/serialization. A wrapper adding schema, ordinal tracking, serialization with ordinals, and is much easier to use API | No |
vertx3 | medium | Vert.x-3 helpers and integration with Kovenant Promises | Yes |
Modules marked with "yes" for Injekt, are modules that have intergration with Kohesive/Injekt and provide prebuild injectable modules that you can easily import providing factories or singletons for dependency injection. Using an Injekt module looks something like:
class MyApp {
companion object : InjektMain() {
// my app starts here with a static main()
platformStatic public fun main(args: Array<String>) {
MyApp().run()
}
// the Injekt system will call me back here on a method I override. And all my functions for registration are
// easy to find on the receiver class
override fun InjektRegistrar.registerInjectables() {
// add my singletons, factories, keyed factories, per-thread factories, ...
...
// import prebuilt Injekt modules
importModule(AmazonS3Injektables)
importModule(JacksonWithKotlinAndJdk8Injektables)
}
}
...
// later, use them in properties in any class
val s3: AmazonS3Client by Delegates.injectLazy()
// or use them anywhere in code
val myObject: CoolObject = Inject.get<ObjectMapper>().readValue(jsonString)
// or another form of the same
val mapper: ObjectMapper = Inject.get()
// or within constructor or method definitions as default values
public fun doSomethingWithS3(s3: AmazonS3Client = Inject.get()) { ... }
}
Some of these modules are "tiny" and may not be overly useful yet, but they carry no extra weight, only have required dependencies and can be expanded over time by anyone that wants to send pull requests. Submitted modules or changes to existing module consist of things not conflicting with Kotlin runtime libraries, and things useful to most Kotlin developers.
Other libraries that we recommend a building blocks for Kotlin applications: