Class ActivityFormDTO

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

public class ActivityFormDTO extends AbstractIdFormDTO
Data Transfer Object (DTO) used for activity creation and update form binding within the SportTrack application.

This DTO replaces direct use of the Activity JPA entity as a @ModelAttribute to prevent mass assignment vulnerabilities (SonarQube java:S4684). It carries only the fields that are safe for user input during activity form submission.

Author:
SportTrack Team
  • Constructor Details

    • ActivityFormDTO

      public ActivityFormDTO()
  • Method Details

    • getId

      public Integer getId()
      Returns the unique identifier of the activity.
      Overrides:
      getId in class AbstractIdFormDTO
      Returns:
      the activity identifier, or null for a new activity
    • setId

      public void setId(Integer id)
      Sets the unique identifier of the activity.
      Overrides:
      setId in class AbstractIdFormDTO
      Parameters:
      id - the activity identifier to assign
    • getDuration

      public double getDuration()
      Returns the total duration of the activity.
      Returns:
      the duration in hours
    • setDuration

      public void setDuration(double duration)
      Sets the total duration of the activity.
      Parameters:
      duration - the duration in hours to assign
    • getTitle

      public String getTitle()
      Returns the title of the activity.
      Returns:
      the activity title
    • setTitle

      public void setTitle(String title)
      Sets the title of the activity.
      Parameters:
      title - the title to assign
    • getDescription

      public String getDescription()
      Returns the description of the activity.
      Returns:
      the activity description
    • setDescription

      public void setDescription(String description)
      Sets the description of the activity.
      Parameters:
      description - the description to assign
    • getRepetition

      public Integer getRepetition()
      Returns the repetition count for the activity.
      Returns:
      the repetition count, or null if not applicable
    • setRepetition

      public void setRepetition(Integer repetition)
      Sets the repetition count for the activity.
      Parameters:
      repetition - the repetition count to assign
    • getDistance

      public Double getDistance()
      Returns the distance covered during the activity.
      Returns:
      the distance in kilometres, or null if not applicable
    • setDistance

      public void setDistance(Double distance)
      Sets the distance covered during the activity.
      Parameters:
      distance - the distance in kilometres to assign
    • getDateA

      public LocalDate getDateA()
      Returns the date of the activity.
      Returns:
      the activity date
    • setDateA

      public void setDateA(LocalDate dateA)
      Sets the date of the activity.
      Parameters:
      dateA - the activity date to assign
    • getStartTime

      public LocalTime getStartTime()
      Returns the start time of the activity.
      Returns:
      the start time
    • setStartTime

      public void setStartTime(LocalTime startTime)
      Sets the start time of the activity.
      Parameters:
      startTime - the start time to assign
    • getLocationCity

      public String getLocationCity()
      Returns the city or location name where the activity was performed.
      Returns:
      the location city name
    • setLocationCity

      public void setLocationCity(String locationCity)
      Sets the city or location name where the activity was performed.
      Parameters:
      locationCity - the location city name to assign
    • getSportId

      public Integer getSportId()
      Returns the identifier of the associated sport.
      Returns:
      the sport identifier
    • setSportId

      public void setSportId(Integer sportId)
      Sets the identifier of the associated sport.
      Parameters:
      sportId - the sport identifier to assign