Package fr.utc.miage.sporttrack.dto
Class AthleteProfileUpdateDTO
java.lang.Object
fr.utc.miage.sporttrack.dto.AthleteProfileUpdateDTO
Data Transfer Object (DTO) used for athlete profile update form binding
within the SportTrack application.
This DTO replaces direct use of the Athlete JPA entity as a
@ModelAttribute to prevent mass assignment vulnerabilities
(SonarQube java:S4684). It exposes only the profile fields that an athlete
is permitted to modify through the profile update form.
- Author:
- SportTrack Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAge()Returns the age of the athlete.getBio()Returns the personal biography of the athlete.Returns the first name of the athlete.Returns the gender of the athlete.Returns the height of the athlete.Returns the last name of the athlete.Returns the practice level of the athlete.Returns the username.Returns the weight of the athlete.voidSets the age of the athlete.voidSets the personal biography of the athlete.voidsetFirstName(String firstName) Sets the first name of the athlete.voidSets the gender of the athlete.voidSets the height of the athlete.voidsetLastName(String lastName) Sets the last name of the athlete.voidsetPracticeLevel(PracticeLevel practiceLevel) Sets the practice level of the athlete.voidsetUsername(String username) Sets the username.voidSets the weight of the athlete.
-
Constructor Details
-
AthleteProfileUpdateDTO
public AthleteProfileUpdateDTO()
-
-
Method Details
-
getUsername
Returns the username.- Returns:
- the athlete's username
-
getFirstName
Returns the first name of the athlete.- Returns:
- the first name
-
getLastName
Returns the last name of the athlete.- Returns:
- the last name
-
getGender
Returns the gender of the athlete.- Returns:
- the
Gender
-
getAge
Returns the age of the athlete.- Returns:
- the age in years
-
getHeight
Returns the height of the athlete.- Returns:
- the height in centimetres
-
getWeight
Returns the weight of the athlete.- Returns:
- the weight in kilograms
-
getPracticeLevel
Returns the practice level of the athlete.- Returns:
- the
PracticeLevel
-
getBio
Returns the personal biography of the athlete.- Returns:
- the bio text
-
setUsername
Sets the username.- Parameters:
username- the username to assign
-
setFirstName
Sets the first name of the athlete.- Parameters:
firstName- the first name to assign
-
setLastName
Sets the last name of the athlete.- Parameters:
lastName- the last name to assign
-
setGender
Sets the gender of the athlete.- Parameters:
gender- theGenderto assign
-
setAge
Sets the age of the athlete.- Parameters:
age- the age in years to assign
-
setHeight
Sets the height of the athlete.- Parameters:
height- the height in centimetres to assign
-
setWeight
Sets the weight of the athlete.- Parameters:
weight- the weight in kilograms to assign
-
setPracticeLevel
Sets the practice level of the athlete.- Parameters:
practiceLevel- thePracticeLevelto assign
-
setBio
Sets the personal biography of the athlete.- Parameters:
bio- the biography text to assign
-