Class SportFormDTO

java.lang.Object
fr.utc.miage.sporttrack.dto.AbstractIdFormDTO
fr.utc.miage.sporttrack.dto.SportFormDTO

public class SportFormDTO extends AbstractIdFormDTO
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 Details

    • SportFormDTO

      public SportFormDTO()
  • Method Details

    • getName

      public String getName()
      Returns the display name of the sport.
      Returns:
      the sport name
    • getDescription

      public String 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

      public SportType getType()
      Returns the measurement type of this sport.
      Returns:
      the SportType
    • setName

      public void setName(String name)
      Sets the display name of the sport.
      Parameters:
      name - the sport name to assign
    • setDescription

      public void setDescription(String description)
      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

      public void setType(SportType type)
      Sets the measurement type for this sport.
      Parameters:
      type - the SportType to assign