In our article Integrate Swagger2 with Spring Boot REST API, we learned to integrate Swagger2 in our Spring Boot REST application. Here in this article, we will learn how to document the Controller and Model class of our Spring Boot project using annotations provided by Springfox Swagger 2. Controller Class Documentation To document our controller class we will use @Api, ... Read More »
Tag Archives: java
Integrate Swagger2 with Spring Boot REST API
Swagger 2 makes the Spring Boot REST API much easier to describe and document. And Swagger2 is very easy to integrate with the Spring Boot application. Here we will learn this step by step and use Swagger 2 to generate Spring Boot REST API project documentation. Adding the Maven Dependencies My pom.xml, where I added the below dependencies to integrate ... Read More »
How to Disabled Swagger-UI in Production in Spring Boot Project
I have a Spring Boot REST API application and I integrated Swagger for documentation and also using it to test API with Swagger-UI. Now my task was to disable the Swagger-UI on our production environment (public domain) and enable it in our dev environment which was on private IP. APPROACH – 1 With Swagger vr-3.0.0 we can add springfox.documentation.enabled=false/true in ... Read More »
Twitter search API- Get tweets and tweets count of hashtag using JAVA twitter client Twitter4j
Twitter search API- Get tweets and tweets count of hashtag using Twitter4j JAVA I have searched many resources on internet for how to obtain tweets count for a particular hashtag. To may observation there is no API exposed by Twitter for getting counts data for a hashtag.But there is a search tweets API that provides tweets data(including retweets) for a ... Read More »
Potential security hole- Final field containing a reference to a mutable object
Potential security hole- Final field containing a reference to a mutable object As a thumb rule, instance fields should never be public. If an instance field is non-final, or is a final reference to a mutable object, then by making the field public, we give up the ability to limit the values that can be stored in the field. So ... Read More »
What is Quick sort and usage of Quick sort in JAVA Arrays.sort method
What is Quick sort and usage of Quick sort in JAVA Arrays.sort method As per JDK-8 Arrays.sort method uses Quick sort algorithm for sorting of data in ascending/descending order. So this post is for persons who wants to know, how does Quick sort works. In JAVA world quick sorting is used to sort an array. In our example we will ... Read More »
What is Merge sort and usage of Merge sort in JAVA Collections.sort method
What is Merge sort and usage of Merge sort in JAVA Collections.sort method Manipulating data in a faster and efficient way has always been the fantasy of every language and JAVA is no untouchable in this case. As per JDK-8 Collections.sort method uses Merge sort algorithm for sorting of data in ascending/descending order. So, what is Merge sort? Well, if ... Read More »
Which is better option: Java clone or Copy constructors or Copy static factory?
Which is better option: Java clone or Copy constructors or Copy static factory? The Cloneable interface was intended for objects to advertise that they permit cloning. Unfortunately it fails to serve this purpose. It’s primary flaw is that it lacks a clone method, and Object’s clone method is protected. So what does Cloneable do, given that it contains no methods? ... Read More »
How to read and parse CSV file
This tutorial shows how to read, parse and print out the values from a CSV file. Say we have a CSV file user-profile.csv where the user name, roll number, age, course name is stored, seperated by comma. Sample file data Extracts the Roll Number and Course from above CVS file, and print it out. Read More »
Difference between JDK, JRE and JVM
If we are a Java developer, it is very often that we think about understanding the JRE,JVM and JDK. It would be quite easy for us to visualize things in logical manner. Let’s see the basic differences between the JDK, JRE and JVM. JDK (Java Development Kit) Java Developer Kit contains tools needed to develop the Java programs, and JRE ... Read More »
Jkoder.com Tutorials, Tips and interview questions for Java, J2EE, Android, Spring, Hibernate, Javascript and other languages for software developers