I am new to spring boot. I have question related to how I should develop a scenario in spring boot.
I have one class (say SingleObject
) having some fields in it. I want to create another object from SingleObject
(say JsonObject
) having some Json
structure derived from values of fields in SingleObject
.
For this conversion I am using static method of a Class (say Converter
); where method takes input of SingleObject
and returns an object of JsonObject
.
How should I implement this scenario in spring?
Should I use @Configuration
annotation for Converter
Class with @Bean
annotation for method which returns JsonObject
?
If I have to use @Configuration
annotation, how should I collect that bean in my main method for further processing?