In a html file, I am trying to get the fields and values in the following DTO using Thymeleaf:
ValuesDTO(serving=100.0, unit=G, energy=160.0, protein=5.0, totalFat=7.0)
So, how can I list values as the following? The labels are static, I just need to get the corresponding value by field name e.g. energyAmount
Energy: 160.0 --> get value of `energy` field
Protein: 5.0 --> get value of `protein` field
Total Fat: 7.0 --> get value of `totalFat` field