Class Faculty
java.lang.Object
example.app.entities.compartments.Faculty
- All Implemented Interfaces:
FileDatabaseCompatible,Serializable
Class Faculty
This class represents a faculty and its attributes.- Id: UUID v4 that is immutable after assignment
- Code: code of the faculty
- Description: description of the faculty (optional)
- Faculty User: Faculty user who is assigned to this faculty
- Faculty Creation Date: Date and time on which the faculty was created. It's immutable
- Assigned Batches: A list of batches that has been assigned to the faculty
- For two faculty to be same, only code needs to be equal
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatches(Batch... batches) /** This method adds a list of batches to the facultybooleanGetter for assigned batchesgetCode()Getter for faculty codeGetter for faculty creation dateGetter for faculty descriptionGetter for faculty usergetId()Getter for faculty idinthashCode()voidremoveBatches(Batch... batches) This method removes a list of batches from the facultyvoidSetter of the faculty codevoidsetDescription(String description) Setter of the faculty description.voidsetFacultyUser(FacultyUser facultyUser) Setter of the faculty usertoString()
-
Constructor Details
-
Faculty
public Faculty(String code, String description, FacultyUser facultyUser) throws NullArgumentException, EmptyArgumentException
-
-
Method Details
-
getId
Getter for faculty id- Specified by:
getIdin interfaceFileDatabaseCompatible- Returns:
- UUID v4
-
getCode
Getter for faculty code- Returns:
- code of the faculty
-
setCode
Setter of the faculty code- Parameters:
code- code of the faculty- Throws:
NullArgumentException- if code is nullEmptyArgumentException- if code is empty
-
getDescription
Getter for faculty description- Returns:
- description of the faculty
-
setDescription
Setter of the faculty description. It can be an empty string as it's optional- Parameters:
description- description of the faculty- Throws:
NullArgumentException- if description is null
-
getFacultyUser
Getter for faculty user- Returns:
- Faculty user
-
setFacultyUser
Setter of the faculty user- Parameters:
facultyUser- Faculty user to be set- Throws:
NullArgumentException- if facultyUser is null
-
getCreationDate
Getter for faculty creation date- Specified by:
getCreationDatein interfaceFileDatabaseCompatible- Returns:
- date and time on which the faculty was created
-
getAssignedBatches
Getter for assigned batches- Returns:
- TreeMap of assigned batches
-
addBatches
public void addBatches(Batch... batches) throws NullArgumentException, DuplicatePresentException, CannotCreateFileException, FileDatabaseConfigFileException, FileDatabaseInternalException, IOException, ClassNotFoundException /** This method adds a list of batches to the faculty- Parameters:
batches- list of batches- Throws:
NullArgumentException- if any of the batch is null. In that case it does not add the batchesDuplicatePresentExceptionCannotCreateFileExceptionFileDatabaseConfigFileExceptionFileDatabaseInternalExceptionIOExceptionClassNotFoundException
-
removeBatches
This method removes a list of batches from the faculty- Parameters:
batches- list of batches to be removed
-
equals
-
hashCode
public int hashCode() -
toString
-