Class BadgeFormDTO

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

public class BadgeFormDTO extends Object
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 Details

    • BadgeFormDTO

      public BadgeFormDTO()
  • Method Details

    • getId

      public Integer getId()
      Returns the unique identifier of the badge.
      Returns:
      the badge identifier, or null for a new badge
    • setId

      public void setId(Integer id)
      Sets the unique identifier of the badge.
      Parameters:
      id - the badge identifier to assign
    • getLabel

      public String getLabel()
      Returns the display label of the badge.
      Returns:
      the badge label
    • setLabel

      public void setLabel(String label)
      Sets the display label of the badge.
      Parameters:
      label - the label to assign
    • getDescription

      public String getDescription()
      Returns the description of the badge's earning criteria.
      Returns:
      the badge description
    • setDescription

      public void setDescription(String description)
      Sets the description of the badge's earning criteria.
      Parameters:
      description - the description 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
    • getMetric

      public Metric getMetric()
      Returns the performance metric for this badge.
      Returns:
      the Metric
    • setMetric

      public void setMetric(Metric metric)
      Sets the performance metric for this badge.
      Parameters:
      metric - the Metric to 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

      public String getIcon()
      Returns the CSS icon class name for this badge.
      Returns:
      the icon class string
    • setIcon

      public void setIcon(String icon)
      Sets the CSS icon class name for this badge.
      Parameters:
      icon - the icon class string to assign