question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create Kotlin extension library for Javalin

See original GitHub issue

There are lots of Kotlin guys that don’t like some parts of the syntax Javalin has. The extension library is just a bunch of different functions to allow more Kotlin-like syntax.

Example from #150 :

Current Kotlin code:

ctx.paramMap()["id"]?.let {
    ...
}

Extension function:

val Context.params: Map<String, String> = this.paramMap()

ctx.params["id"].let { }

The library could be supplied as a separate artifact (eg io.javalin.k-javalin or so) to not bother the Java users.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ShikaSDcommented, Mar 25, 2018

I agree, though it is not limited to context params only. Will check if the extensions can improve the syntax more significantly, as I am not sure that Javalin will benefit from these (^^^) extensions a lot.

0reactions
tipsycommented, May 26, 2018

Great, I’ve started thinking that keeping the library consistent across Java and Kotlin is a main goal of the project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - A lightweight Java and Kotlin web framework
Javalin - A lightweight Java and Kotlin web framework. Create REST APIs in Java or Kotlin easily.
Read more >
Building a Kotlin extensions library - Android Developers
In this codelab, you'll build your own Kotin extensions library for an API that was originally created in the Java programming language.
Read more >
inforion/kotlin-extensions: Library with various ... - GitHub
Library with various extensions and helper functions - GitHub - inforion/kotlin-extensions: Library with various extensions and helper functions.
Read more >
Extensions | Kotlin
Extensions do not actually modify the classes they extend. By defining an extension, you are not inserting new members into a class, only...
Read more >
Javalin: A Simple, Modern Web Server Framework
Many developers would say Javalin is a library rather than a framework ... in Javalin, unlike in most frameworks, you never extend anything; ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found