Package fr.utc.miage.sporttrack.dto
Class BadgeFormDTO
java.lang.Object
fr.utc.miage.sporttrack.dto.BadgeFormDTO
Data Transfer Object (DTO) used for badge creation and update form binding
within the SportTrack application.
This DTO replaces direct use of the Badge JPA entity as a
@ModelAttribute to prevent mass assignment vulnerabilities
(SonarQube java:S4684). It carries only the fields that are safe for
admin input during badge form submission.
- Author:
- SportTrack Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the badge's earning criteria.getIcon()Returns the CSS icon class name for this badge.getId()Returns the unique identifier of the badge.getLabel()Returns the display label of the badge.Returns the performance metric for this badge.Returns the identifier of the associated sport.doubleReturns the threshold value required to earn this badge.voidsetDescription(String description) Sets the description of the badge's earning criteria.voidSets the CSS icon class name for this badge.voidSets the unique identifier of the badge.voidSets the display label of the badge.voidSets the performance metric for this badge.voidsetSportId(Integer sportId) Sets the identifier of the associated sport.voidsetThreshold(double threshold) Sets the threshold value required to earn this badge.
-
Constructor Details
-
BadgeFormDTO
public BadgeFormDTO()
-
-
Method Details
-
getId
Returns the unique identifier of the badge.- Returns:
- the badge identifier, or
nullfor a new badge
-
setId
Sets the unique identifier of the badge.- Parameters:
id- the badge identifier to assign
-
getLabel
Returns the display label of the badge.- Returns:
- the badge label
-
setLabel
Sets the display label of the badge.- Parameters:
label- the label to assign
-
getDescription
Returns the description of the badge's earning criteria.- Returns:
- the badge description
-
setDescription
Sets the description of the badge's earning criteria.- Parameters:
description- the description to assign
-
getSportId
Returns the identifier of the associated sport.- Returns:
- the sport identifier
-
setSportId
Sets the identifier of the associated sport.- Parameters:
sportId- the sport identifier to assign
-
getMetric
Returns the performance metric for this badge.- Returns:
- the
Metric
-
setMetric
Sets the performance metric for this badge.- Parameters:
metric- theMetricto assign
-
getThreshold
public double getThreshold()Returns the threshold value required to earn this badge.- Returns:
- the threshold value
-
setThreshold
public void setThreshold(double threshold) Sets the threshold value required to earn this badge.- Parameters:
threshold- the threshold to assign
-
getIcon
Returns the CSS icon class name for this badge.- Returns:
- the icon class string
-
setIcon
Sets the CSS icon class name for this badge.- Parameters:
icon- the icon class string to assign
-