The Spring @Controller and @RestController Annotations 1. Overview In this quick tutorial, we’ll discuss the difference between @Controller and @RestController annotations in Spring MVC. The first annotation is used for traditional Spring controllers and has been part of the framework for a very long time. The @RestController annotation was introduced… Continue Reading spring-controller-vs-restcontroller

Collection Factory Methods for Vavr 1. Overview Vavr is a powerful library for Java 8+, built on top of Java lambda expressions. Inspired by the Scala language, Vavr adds functional programming constructs to the Java language, such as pattern-matching, control structures, data types, persistent and immutable collections, and more. In… Continue Reading vavr-collection-factory-methods

Customizing HTTP Endpoints in Spring Data REST 1. Introduction Spring Data REST can remove a lot of boilerplate that’s natural to REST services. In this tutorial, we’ll explore how to customize some of Spring Data REST’s HTTP binding defaults. 2. Spring Data REST Repository Fundamentals To get started, let’s create an… Continue Reading spring-data-rest-customize-http-endpoints

Delegation Pattern in Kotlin 1. Overview There are many use cases in which delegation is preferred to inheritance. Kotlin has great language-level support for this. In this tutorial, we’ll talk about Kotlin’s native support for the delegation pattern and see it in action. 2. Implementation First, let’s assume we have… Continue Reading kotlin-delegation-pattern

Filtering and Transforming Collections in Guava 1. Overview In this tutorial, we’ll illustrate how to filter and transform collections with Guava. We will filter using Predicates, transform using the Functions that the library provides and finally, we’ll see how to combine both filtering and transforming. Further reading: New Stream, Comparator… Continue Reading guava-filter-and-transform-a-collection