Package fr.utc.miage.sporttrack.dto
Class ChallengeFormDTO
java.lang.Object
fr.utc.miage.sporttrack.dto.ChallengeFormDTO
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the textual description of the challenge.Returns the end date of the challenge.Returns the performance metric for ranking in this challenge.getName()Returns the display name of the challenge.Returns the start date of the challenge.voidsetDescription(String description) Sets the textual description of the challenge.voidsetEndDate(LocalDate endDate) Sets the end date of the challenge.voidSets the performance metric for ranking in this challenge.voidSets the display name of the challenge.voidsetStartDate(LocalDate startDate) Sets the start date of the challenge.
-
Constructor Details
-
ChallengeFormDTO
public ChallengeFormDTO()
-
-
Method Details
-
getName
Returns the display name of the challenge.- Returns:
- the challenge name
-
getDescription
Returns the textual description of the challenge.- Returns:
- the challenge description
-
getStartDate
Returns the start date of the challenge.- Returns:
- the start date
-
getEndDate
Returns the end date of the challenge.- Returns:
- the end date
-
getMetric
Returns the performance metric for ranking in this challenge.- Returns:
- the
Metric
-
setName
Sets the display name of the challenge.- Parameters:
name- the challenge name to assign
-
setDescription
Sets the textual description of the challenge.- Parameters:
description- the description to assign
-
setStartDate
Sets the start date of the challenge.- Parameters:
startDate- the start date to assign
-
setEndDate
Sets the end date of the challenge.- Parameters:
endDate- the end date to assign
-
setMetric
Sets the performance metric for ranking in this challenge.- Parameters:
metric- theMetricto assign
-