I'm a beginner with Spring Boot and Dependency Injection and I can't get my head around Constructor based Dependency Injection in Spring Boot. I have class called ParameterDate
that look like this:
public class ParameterDate {
private Date parameterDateUnadjusted;
private Date parameterDateAdjusted;
private Date parameterDateAdded;
private Date parameterDateChanged;
}
I have another class where I want to use ParameterDate
. Normally I would do Field based Injection with
@Autowired
ParameterDate parameterDate;
And where ever needed I just use parameterDate
.
How would I do this with Constructor based Injection?