Posts about Kotlin

Custom Hibernate constraint in Kotlin

February 17th 2023 Kotlin Quarkus

Quarkus uses Hibernate Validator for validation. This means that the correct way to do custom field validation is to create a custom constraint. The steps to do this are well documented. However, since I am still learning Kotlin, it was not trivial for me to convert the sample code to Kotlin, especially the annotation part.

Mockito and non-null types in Kotlin

December 23rd 2022 Kotlin

The null safety feature in Kotlin is great for preventing NullPointerExceptions that are thrown at runtime. Unfortunately, it can sometimes cause problems when interacting with Java code or libraries. I recently ran into such a problem when trying to mock a dependency with Mockito.

Learning Kotlin with Advent of Code 2017

December 29th 2017 Advent of Code Kotlin

It's December again and for the third year in a row I've spent a significant amount of time solving Advent of Code programming challenges. To make it even more interesting, I decided to write the solutions in Kotlin - a programming language I heard a lot of good things about, but had no prior experience in.