
Validate Arguments via Google Guava
Google Guava Preconditions are quite useful for validating arguments of methods. Here it is an example: public void setAge(int age)
Google Guava Preconditions are quite useful for validating arguments of methods. Here it is an example: public void setAge(int age)
We can check if a given port is free by trying to construct a ServerSocket with the port that needs
A zip file is a compressed file that can hold one or more files. The following code snippet lets us
Adding Log4j2 in a Spring Boot application can be done in two steps. For Maven, in pom.xml, exclude Spring Boot’s
ArrayList has an overloaded method that accepts a string, as well as an Integer, as an argument. The remove method
The Hijri calendar system is somewhat different from the Gregorian calendar. This example does not discuss the complete Hijri calendar.
Moving away from the age old way of fixed arguments, Java supports variable arguments. The code sample below illustrates variable
Java has a very powerful library for REGEX. A very basic usage of REGEX is being presented in the code
For disabling OSIV, we need to set up spring.jpa.open-in-view in application.properties as follows: spring.jpa.open-in-view=false