Converting Kotlin Data Class from JSON using GSON 1. Overview In this short tutorial, we’ll discuss how to convert a data class in Kotlin to JSON string and vice versa using Gson Java library. 2. Maven Dependency Before we start, let’s add Gson to our pom.xml: <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.5</version> </dependency> 3.… Continue Reading kotlin-json-convert-data-class

Implementing a Custom Lombok Annotation 1. Overview In this tutorial, we’ll implement a custom annotation using Lombok to remove the boiler-plate around implementing Singletons in an application. Lombok is a powerful Java library that aims to reduce the boiler-plate code in Java. If you’re not familiar with it, here you… Continue Reading lombok-custom-annotation

The HttpMediaTypeNotAcceptableException in Spring MVC 1. Overview In this quick article, we’ll have a look at the HttpMediaTypeNotAcceptableException exception, and understand the cases where we might encounter it. 2. The Problem When implementing an API endpoint with Spring, we generally need to specify the consumed/produced media types (via the consumes… Continue Reading spring-httpmediatypenotacceptable

Project Configuration with Spring Table of Contents * 1. Configuration Must Be Environment Specific * 2. The .properties files for Each Environment * 3. The Spring Configuration * 4. Setting the Property in Each Environment * 5. Testing and Maven * 6. Going Further * 7. Conclusion 1. Configuration Must… Continue Reading project-configuration-with-spring

REST Query Language – Implementing OR Operation 1. Overview In this quick article, we’ll extend the advanced search operations that we implemented in the previous article and include OR-based search criteria into our REST API Query Language. 2. Implementation Approach Before, all the criteria in the search query parameter formed… Continue Reading rest-api-query-search-or-operation