Class Sport
java.lang.Object
fr.utc.miage.sporttrack.entity.activity.Sport
JPA entity representing a sport discipline within the SportTrack application.
Each sport is characterised by a name, a description, a calorie burn rate per hour, a measurement type (duration, repetition, or distance), and an active flag that determines whether the sport is currently available for selection when creating new activities.
- Author:
- SportTrack Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the average calorie burn rate per hour for this sport.Returns the textual description of this sport.intgetId()Returns the unique identifier of this sport.getName()Returns the display name of this sport.getType()Returns the measurement type of this sport.booleanisActive()Returns whether this sport is currently active and available for selection.voidsetActive(boolean active) Sets whether this sport is active and available for selection.voidsetCaloriesPerHour(double caloriesPerHour) Sets the average calorie burn rate per hour for this sport.voidsetDescription(String description) Sets the textual description of this sport.voidsetId(int id) Sets the unique identifier of this sport.voidSets the display name of this sport.voidSets the measurement type for this sport.
-
Constructor Details
-
Sport
public Sport()No-argument constructor required by JPA.
-
-
Method Details
-
setId
public void setId(int id) Sets the unique identifier of this sport.- Parameters:
id- the database identifier to assign
-
setName
Sets the display name of this sport.- Parameters:
name- the sport name to assign
-
setDescription
Sets the textual description of this sport.- Parameters:
description- the description to assign
-
setCaloriesPerHour
public void setCaloriesPerHour(double caloriesPerHour) Sets the average calorie burn rate per hour for this sport.- Parameters:
caloriesPerHour- the calories burned per hour
-
setType
Sets the measurement type for this sport.- Parameters:
type- theSportTypeto assign
-
setActive
public void setActive(boolean active) Sets whether this sport is active and available for selection.- Parameters:
active-trueto activate,falseto deactivate
-
getId
public int getId()Returns the unique identifier of this sport.- Returns:
- the sport's database identifier
-
getName
Returns the display name of this sport.- Returns:
- the sport name
-
getDescription
Returns the textual description of this sport.- Returns:
- the sport description
-
getType
Returns the measurement type of this sport.- Returns:
- the
SportType
-
getCaloriesPerHour
public double getCaloriesPerHour()Returns the average calorie burn rate per hour for this sport.- Returns:
- the calories burned per hour
-
isActive
public boolean isActive()Returns whether this sport is currently active and available for selection.- Returns:
trueif the sport is active,falseotherwise
-