Package src.model.internship
Class InternshipOpportunity
java.lang.Object
src.model.internship.InternshipOpportunity
InternshipOpportunity Class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LocalDateprivate LocalDateprivate Stringprivate ArrayList<CompanyRepresentative> private Stringprivate InternshipLevelprivate Stringstatic final intThe maximum number of slots that an internship opportunity is allowed to open.private intprivate intprivate Stringprivate Statusprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionInternshipOpportunity(String internshipTitle, String description, InternshipLevel internshipLevel, String preferredMajor, LocalDate applicationOpeningDate, LocalDate applicationClosingDate, String companyName, ArrayList<CompanyRepresentative> companyRepresentatives, int numberOfSlots) Constructs aInternshipOpportunityinstance with all required fields. -
Method Summary
Modifier and TypeMethodDescriptionintAddsrepToAddtocompanyRepresentativesvoidDecrements the number of slots left for this internship opportunity by 1.intdeleteCompanyRepresentative(CompanyRepresentative repToDelete) DeletesrepToDeletefromcompanyRepresentativesGetter forapplicationClosingDateGetter forapplicationOpeningDateGetter forcompanyNameGetter forcompanyRepresentativesGetter fordescriptionGetter forinternshipLevelGetter forinternshipTitleintGetter fornumberOfSlotsGetter forpreferredMajorintGetter fornumberOfSlotsLeftGetter forstatusbooleanGetter forvisiblevoidIncrements the number of slots left for this internship opportunity by 1.voidsetApplicationClosingDate(LocalDate applicationClosingDate) Setter forapplicationClosingDatevoidsetApplicationOpeningDate(LocalDate applicationOpeningDate) Setter forapplicationOpeningDatevoidsetCompanyName(String companyName) Setter forcompanyNamevoidsetDescription(String description) Setter fordescriptionvoidsetInternshipLevel(InternshipLevel internshipLevel) Setter forinternshipLevelvoidsetInternshipTitle(String internshipTitle) Setter forinternshipTitleintsetNumberOfSlots(int numberOfSlots) Setter fornumberOfSlotsvoidsetPreferredMajor(String preferredMajor) Setter forpreferredMajorvoidSetter forstatusvoidsetVisibility(boolean visible) Setter forvisible
-
Field Details
-
MAX_NUM_SLOTS
public static final int MAX_NUM_SLOTSThe maximum number of slots that an internship opportunity is allowed to open.- See Also:
-
internshipTitle
-
description
-
internshipLevel
-
preferredMajor
-
applicationOpeningDate
-
applicationClosingDate
-
status
-
companyName
-
companyRepresentatives
-
numberOfSlots
private int numberOfSlots -
numberOfSlotsLeft
private int numberOfSlotsLeft -
visible
private boolean visible
-
-
Constructor Details
-
InternshipOpportunity
public InternshipOpportunity(String internshipTitle, String description, InternshipLevel internshipLevel, String preferredMajor, LocalDate applicationOpeningDate, LocalDate applicationClosingDate, String companyName, ArrayList<CompanyRepresentative> companyRepresentatives, int numberOfSlots) Constructs aInternshipOpportunityinstance with all required fields.- Parameters:
internshipTitle- Thetitleof the internship opportunity.description- Thedescriptionof the internship opportunity.internshipLevel- The internship level of the internship opportunity.preferredMajor- The preferred major of the internship opportunity.applicationOpeningDate- The application opening date of the internship opportunity. Must not be null.applicationClosingDate- The application closing date of the internship opportunity. Must not be null and must be on or after the opening date.companyName- The name of the company offering the internship opportunity.companyRepresentatives- The list of company representatives associated with the internship opportunity. Can be null.numberOfSlots- The maximum number of slots available for this internship opportunity. Must be greater than 0 and less than or equal toMAX_NUM_SLOTS.- Throws:
IllegalArgumentException- if the application dates are invalid (null or closing date is before opening date).IllegalArgumentException- if the number of slots is outside the valid range (1 toMAX_NUM_SLOTS).
-
-
Method Details
-
getInternshipTitle
Getter forinternshipTitle- Returns:
internshipTitle
-
setInternshipTitle
Setter forinternshipTitle- Parameters:
internshipTitle- theinternshipTitleto set
-
getDescription
Getter fordescription- Returns:
description
-
setDescription
Setter fordescription- Parameters:
description- thedescriptionto set
-
getInternshipLevel
Getter forinternshipLevel- Returns:
internshipLevel
-
setInternshipLevel
Setter forinternshipLevel- Parameters:
internshipLevel- theinternshipLevelto set
-
getPreferredMajor
Getter forpreferredMajor- Returns:
preferredMajor
-
setPreferredMajor
Setter forpreferredMajor- Parameters:
preferredMajor- thepreferredMajorto set
-
getApplicationOpeningDate
Getter forapplicationOpeningDate- Returns:
applicationOpeningDate
-
setApplicationOpeningDate
Setter forapplicationOpeningDate- Parameters:
applicationOpeningDate- theapplicationOpeningDateto set
-
getApplicationClosingDate
Getter forapplicationClosingDate- Returns:
applicationClosingDate
-
setApplicationClosingDate
Setter forapplicationClosingDate- Parameters:
applicationClosingDate- theapplicationClosingDateto set
-
getStatus
Getter forstatus- Returns:
status
-
setStatus
Setter forstatus- Parameters:
status- thestatusto set
-
getCompanyName
Getter forcompanyName- Returns:
companyName
-
setCompanyName
Setter forcompanyName- Parameters:
companyName- thecompanyNameto set
-
getCompanyRepresentatives
Getter forcompanyRepresentatives- Returns:
companyRepresentatives
-
addCompanyRepresentative
AddsrepToAddtocompanyRepresentatives- Parameters:
repToAdd- theCompanyRepresentativeto add- Returns:
- 0 if successful, 1 if unsuccessful
-
deleteCompanyRepresentative
DeletesrepToDeletefromcompanyRepresentatives- Parameters:
repToDelete- theCompanyRepresentativeto delete- Returns:
- 0 if successful, 1 if unsuccessful
-
getNumberOfSlots
public int getNumberOfSlots()Getter fornumberOfSlots- Returns:
numberOfSlots
-
setNumberOfSlots
public int setNumberOfSlots(int numberOfSlots) Setter fornumberOfSlots- Parameters:
numberOfSlots- thenumberOfSlotsto set. Must be between 1 andMAX_NUM_SLOTSinclusive.- Returns:
- 0 if successful, 1 if unsuccessful.
-
decrementSlotsLeft
public void decrementSlotsLeft()Decrements the number of slots left for this internship opportunity by 1. -
incrementSlotsLeft
public void incrementSlotsLeft()Increments the number of slots left for this internship opportunity by 1. -
getSlotsLeft
public int getSlotsLeft()Getter fornumberOfSlotsLeft- Returns:
- the number of slots remaining for this internship opportunity
-
getVisibility
public boolean getVisibility()Getter forvisible- Returns:
visible
-
setVisibility
public void setVisibility(boolean visible) Setter forvisible- Parameters:
visible- thevisibleto set
-