Groovy def Keyword
1. Overview In this quick tutorial, we’ll explore the concept of the def keyword in Groovy. It provides an optional typing feature to this dynamic JVM language. 2. Meaning of the def Keyword The def...
View ArticleGeneric Constructors in Java
1. Overview We previously discussed the basics of Java Generics. In this tutorial, we’ll have a look at Generic Constructors in Java. A generic constructor is a constructor that has at least one...
View ArticleSpring Data JPA Delete and Relationships
1. Overview In this tutorial, we’ll have a look at how deleting is done in Spring Data JPA. 2. Sample Entity As we know from the Spring Data JPA reference documentation, repository interfaces provide...
View ArticleGuide to Google Tink
1. Introduction Nowadays, many developers use cryptographic techniques to protect user data. In cryptography, small implementation errors can have serious consequences, and understanding how to...
View ArticleSet Operations in Java
1. Introduction A set is a handy way to represent a unique collection of items. In this tutorial, we’ll learn more about what that means and how we can use one in Java. 2. A Bit of Set Theory 2.1. What...
View ArticleREST Assured Authentication
1. Overview In this tutorial, we’ll analyze how we can authenticate with REST Assured to test and validate a secured API properly. The tool provides support for several authentication schemes: Basic...
View ArticleIntroduction to SPNEGO/Kerberos Authentication in Spring
1. Overview In this tutorial, we’ll understand the basics of the Kerberos authentication protocol. We’ll also cover the need for SPNEGO in connection with Kerberos. Finally, we’ll see how to make use...
View ArticleJava Weekly, Issue 278
Here we go… 1. Spring and Java >> Microservices with Spring Boot and Spring Cloud. From config server to OAuth2 server (without inMemory things — Part 2 [itnext.io] This week’s installment shows...
View ArticleRendering Exceptions in JSON with Spring
1. Introduction Happy-path REST is pretty well-understood, and Spring makes this easy to do in Java. But what about when things go wrong? In this tutorial, we’ll go over passing a Java exception as...
View ArticleHow to Process YAML with Jackson
1. Introduction In this short tutorial, we’re going to learn how to use Jackson to read and write YAML files. After we go over our example structure, we’ll use the ObjectMapper to read a YAML file into...
View ArticlePattern Matching in Strings in Groovy
1. Overview In this article, we’ll look at the Groovy language features for pattern matching in Strings. We’ll see how Groovy’s batteries-included approach provides us with a powerful and ergonomic...
View ArticleConsole I/O in Kotlin
1. Introduction When we learn a new programing language, it’s common to start with console I/O. In this tutorial, we’ll explore some alternatives for handling console I/O with Kotlin. 2. Using the...
View ArticleMaps in Groovy
1. Overview Groovy extends the Map API in Java to provide methods for operations such as filtering, searching and sorting. It also provides a variety of shorthand ways of creating and manipulating...
View ArticleMongoDB BSON Guide
1. Introduction In this tutorial, we’ll be looking at BSON and how we can use it to interact with MongoDB. Now, an in-depth description of MongoDB and all of its capabilities is beyond the scope of...
View ArticleJava 9 Migration Issues and Resolutions
1. Overview The Java platform used to have a monolithic architecture, bundling all packages as a single unit. In Java 9, this was streamlined with the introduction of the Java Platform Module System...
View ArticleDifference Between @Size, @Length, and @Column(length=value)
1. Overview In this quick tutorial, we’ll take a look at JSR-330‘s @Size, Hibernate‘s @Length and JPA @Column‘s length attribute. At first blush, these may seem the same, but they perform different...
View ArticleCheck If a String Contains a Substring
1. Overview In this tutorial, we’ll review several ways of checking if a String contains a substring, and we’ll compare the performance of each. 2. String.indexOf Let’s first try using the...
View ArticleWebClient Requests with Parameters
1. Overview A lot of frameworks and projects are introducing reactive programming and asynchronous request handling. Consequently, Spring 5 introduced a reactive WebClient implementation as a part of...
View ArticleJackson Support for Kotlin
1. Overview In this tutorial, we’ll discuss the Jackson support for Kotlin. We’ll explore how to serialize and deserialize both Objects and Collections. We’ll also make use of @JsonProperty and...
View ArticleSpring Data JPA and Named Entity Graphs
1. Overview Simply put, Entity Graphs are another way to describe a query in JPA 2.1. We can use them to formulate better-performing queries. In this tutorial, we’re going to learn how to implement...
View Article