Class ChallengeFormDTO

java.lang.Object
fr.utc.miage.sporttrack.dto.ChallengeFormDTO

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

This DTO replaces direct use of the Challenge 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 challenge form submission.

Author:
SportTrack Team
  • Constructor Details

    • ChallengeFormDTO

      public ChallengeFormDTO()
  • Method Details

    • getName

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

      public String getDescription()
      Returns the textual description of the challenge.
      Returns:
      the challenge description
    • getStartDate

      public LocalDate getStartDate()
      Returns the start date of the challenge.
      Returns:
      the start date
    • getEndDate

      public LocalDate getEndDate()
      Returns the end date of the challenge.
      Returns:
      the end date
    • getMetric

      public Metric getMetric()
      Returns the performance metric for ranking in this challenge.
      Returns:
      the Metric
    • setName

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

      public void setDescription(String description)
      Sets the textual description of the challenge.
      Parameters:
      description - the description to assign
    • setStartDate

      public void setStartDate(LocalDate startDate)
      Sets the start date of the challenge.
      Parameters:
      startDate - the start date to assign
    • setEndDate

      public void setEndDate(LocalDate endDate)
      Sets the end date of the challenge.
      Parameters:
      endDate - the end date to assign
    • setMetric

      public void setMetric(Metric metric)
      Sets the performance metric for ranking in this challenge.
      Parameters:
      metric - the Metric to assign