java.lang.Object
fr.utc.miage.sporttrack.entity.activity.Sport

@Entity public class Sport extends Object
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
    Constructor
    Description
    No-argument constructor required by JPA.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the average calorie burn rate per hour for this sport.
    Returns the textual description of this sport.
    int
    Returns the unique identifier of this sport.
    Returns the display name of this sport.
    Returns the measurement type of this sport.
    boolean
    Returns whether this sport is currently active and available for selection.
    void
    setActive(boolean active)
    Sets whether this sport is active and available for selection.
    void
    setCaloriesPerHour(double caloriesPerHour)
    Sets the average calorie burn rate per hour for this sport.
    void
    setDescription(String description)
    Sets the textual description of this sport.
    void
    setId(int id)
    Sets the unique identifier of this sport.
    void
    Sets the display name of this sport.
    void
    Sets the measurement type for this sport.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void setName(String name)
      Sets the display name of this sport.
      Parameters:
      name - the sport name to assign
    • setDescription

      public void setDescription(String description)
      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

      public void setType(SportType type)
      Sets the measurement type for this sport.
      Parameters:
      type - the SportType to assign
    • setActive

      public void setActive(boolean active)
      Sets whether this sport is active and available for selection.
      Parameters:
      active - true to activate, false to deactivate
    • getId

      public int getId()
      Returns the unique identifier of this sport.
      Returns:
      the sport's database identifier
    • getName

      public String getName()
      Returns the display name of this sport.
      Returns:
      the sport name
    • getDescription

      public String getDescription()
      Returns the textual description of this sport.
      Returns:
      the sport description
    • getType

      public SportType 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:
      true if the sport is active, false otherwise