Package fr.utc.miage.sporttrack.dto
Class SportFormDTO
java.lang.Object
fr.utc.miage.sporttrack.dto.AbstractIdFormDTO
fr.utc.miage.sporttrack.dto.SportFormDTO
Data Transfer Object (DTO) used for sport creation and update form binding
within the SportTrack application.
This DTO replaces direct use of the Sport JPA entity as a
@ModelAttribute to prevent mass assignment vulnerabilities
(SonarQube java:S4684). An id of 0 indicates a new sport
creation, while a positive id indicates an update to an existing sport.
- Author:
- SportTrack Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the average calorie burn rate per hour for this sport.Returns the textual description of the sport.getName()Returns the display name of the sport.getType()Returns the measurement type of this sport.voidsetCaloriesPerHour(double caloriesPerHour) Sets the average calorie burn rate per hour for this sport.voidsetDescription(String description) Sets the textual description of the sport.voidSets the display name of the sport.voidSets the measurement type for this sport.Methods inherited from class fr.utc.miage.sporttrack.dto.AbstractIdFormDTO
getId, setId
-
Constructor Details
-
SportFormDTO
public SportFormDTO()
-
-
Method Details
-
getName
Returns the display name of the sport.- Returns:
- the sport name
-
getDescription
Returns the textual description of the sport.- Returns:
- the sport description
-
getCaloriesPerHour
public double getCaloriesPerHour()Returns the average calorie burn rate per hour for this sport.- Returns:
- the calories burned per hour
-
getType
Returns the measurement type of this sport.- Returns:
- the
SportType
-
setName
Sets the display name of the sport.- Parameters:
name- the sport name to assign
-
setDescription
Sets the textual description of the sport.- Parameters:
description- the description to assign
-
setCaloriesPerHour
public void setCaloriesPerHour(double caloriesPerHour) Sets the average calorie burn rate per hour for this sport.- Parameters:
caloriesPerHour- the calories burned per hour to assign
-
setType
Sets the measurement type for this sport.- Parameters:
type- theSportTypeto assign
-