In my model I have the following:
private Date exampleDate;
public Testing(Date exampleDate) {
this.exampleDate = exampleDate;
}
public Date getExampleDate() {
return (Date) this.exampleDate.clone();
}
public void setExampleDate(Date exampleDate) {
this.exampleDate = (Date) exampleDate.clone();
}
And I am trying to output an array of objects as follows
@RestController
public class TestingController {
@GetMapping("/saved")
public List<Testing> getData() {
List<Testing> savedDatas = new ArrayList<>(Arrays.asList(
new Testing(
1,
"Text",
2000-1- 1),
new Testing(
2,
"Text2",
new Date(27 / 03 / 19)),
I tried to use new Date but that doesn't work, so what exactly do I need to pass as the third argument as type Date
instead of String or int?!?!