Package edu.ntnu.idatt1002.k1g4.people
Class Competitor
java.lang.Object
edu.ntnu.idatt1002.k1g4.people.Person
edu.ntnu.idatt1002.k1g4.people.Competitor
The type Competitor.
-
Constructor Summary
ConstructorsConstructorDescriptionCompetitor(String name, LocalDate birthDate, Sex sex, int competingNumber, boolean hasLicense, boolean isPenalized) Instantiates a new Competitor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets birthdate of the competitor.intGets the shirt number of the competitor.getSex()Gets sex of the competitor.inthashCode()booleanDoes the competitor have a license.booleanIs the competitor penalized.voidsetCompetingNumber(int competingNumber) Set a new shirt number for the competitor.voidsetHasLicense(boolean hasLicense) Updates the license of the competitor.voidsetPenalized(boolean penalized) Sets penalized status of the 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 competitorbirthDate- the birth date of the competitorsex- the sex of the competitorcompetingNumber- the shirt number of the competitor (not id)hasLicense- if the competitor has a licenseisPenalized- if the competitor is penalized- Throws:
IllegalArgumentException- the illegal argument exception
-
-
Method Details
-
getBirthDate
Gets birthdate of the competitor.- Returns:
- the birthdate
-
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
-
hashCode
public int hashCode()
-