Class Competitor

java.lang.Object
edu.ntnu.idatt1002.k1g4.people.Person
edu.ntnu.idatt1002.k1g4.people.Competitor

public class Competitor extends Person
The type Competitor.
  • Constructor Details

    • Competitor

      public Competitor(String name, LocalDate birthDate, Sex sex, int competingNumber, boolean hasLicense, boolean isPenalized) throws IllegalArgumentException
      Instantiates a new Competitor.
      Parameters:
      name - the name of the competitor
      birthDate - the birth date of the competitor
      sex - the sex of the competitor
      competingNumber - the shirt number of the competitor (not id)
      hasLicense - if the competitor has a license
      isPenalized - if the competitor is penalized
      Throws:
      IllegalArgumentException - the illegal argument exception
  • Method Details

    • getBirthDate

      public LocalDate getBirthDate()
      Gets birthdate of the competitor.
      Returns:
      the birthdate
    • getSex

      public Sex getSex()
      Gets sex of the competitor.
      Returns:
      the sex
    • getCompetingNumber

      public int getCompetingNumber()
      Gets the shirt number of the competitor.
      Returns:
      the shirt number
    • isHasLicense

      public boolean isHasLicense()
      Does the competitor have a license.
      Returns:
      the boolean
    • isPenalized

      public boolean isPenalized()
      Is the competitor penalized.
      Returns:
      the boolean
    • setCompetingNumber

      public void setCompetingNumber(int competingNumber)
      Set a new shirt number for the competitor.
      Parameters:
      competingNumber - the shirt number
    • setHasLicense

      public void setHasLicense(boolean hasLicense)
      Updates the license of the competitor.
      Parameters:
      hasLicense - license status
    • setPenalized

      public void setPenalized(boolean penalized)
      Sets penalized status of the competitor.
      Parameters:
      penalized - penalized status
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object