StudentLoanManagement
com.student_loan.model.Loan Class Reference

Classes

enum  Status
 

Public Member Functions

 Loan ()
 
 Loan (Long id, Long lender, Long borrower, Long item, Date loanDate, Date estimatedReturnDate, Date realReturnDate, Status loanStatus, Double rating, String observations)
 
Long getId ()
 
void setId (Long id)
 
Long getLender ()
 
void setLender (Long lender)
 
Long getBorrower ()
 
void setBorrower (Long borrower)
 
Long getItem ()
 
void setItem (Long item)
 
Date getLoanDate ()
 
void setLoanDate (Date loanDate)
 
Date getEstimatedReturnDate ()
 
void setEstimatedReturnDate (Date estimatedReturnDate)
 
Date getRealReturnDate ()
 
void setRealReturnDate (Date realReturnDate)
 
Status getLoanStatus ()
 
void setLoanStatus (Status loanStatus)
 
Double getRating ()
 
void setRating (Double rating)
 
String getObservations ()
 
void setObservations (String observations)
 
String toString ()
 

Detailed Description

Entity class representing a loan in the system. Maps to the "loans" table in the database.

Definition at line 12 of file Loan.java.

Constructor & Destructor Documentation

◆ Loan() [1/2]

com.student_loan.model.Loan.Loan ( )

Default constructor for the Loan class.

Definition at line 88 of file Loan.java.

◆ Loan() [2/2]

com.student_loan.model.Loan.Loan ( Long  id,
Long  lender,
Long  borrower,
Long  item,
Date  loanDate,
Date  estimatedReturnDate,
Date  realReturnDate,
Status  loanStatus,
Double  rating,
String  observations 
)

Constructor for the Loan class.

Parameters
idThe unique identifier for the loan.
lenderThe ID of the lender.
borrowerThe ID of the borrower.
itemThe ID of the item being loaned.
loanDateThe date when the loan was initiated.
estimatedReturnDateThe estimated return date for the loaned item.
realReturnDateThe actual return date for the loaned item.
loanStatusThe status of the loan.
ratingThe rating given for the loan transaction.
observationsAdditional observations or comments about the loan.

Definition at line 105 of file Loan.java.

Member Function Documentation

◆ getBorrower()

Long com.student_loan.model.Loan.getBorrower ( )

Gets the ID of the borrower associated with the loan.

Returns
The ID of the borrower.

Definition at line 159 of file Loan.java.

◆ getEstimatedReturnDate()

Date com.student_loan.model.Loan.getEstimatedReturnDate ( )

Gets the estimated return date for the loaned item.

Returns
The estimated return date for the loaned item.

Definition at line 213 of file Loan.java.

◆ getId()

Long com.student_loan.model.Loan.getId ( )

Gets the unique identifier for the loan.

Returns
The unique identifier for the loan.

Definition at line 123 of file Loan.java.

◆ getItem()

Long com.student_loan.model.Loan.getItem ( )

Gets the ID of the item being loaned.

Returns
The ID of the item being loaned.

Definition at line 177 of file Loan.java.

◆ getLender()

Long com.student_loan.model.Loan.getLender ( )

Gets the ID of the lender associated with the loan.

Returns
The ID of the lender.

Definition at line 141 of file Loan.java.

◆ getLoanDate()

Date com.student_loan.model.Loan.getLoanDate ( )

Gets the date when the loan was initiated.

Returns
The date when the loan was initiated.

Definition at line 195 of file Loan.java.

◆ getLoanStatus()

Status com.student_loan.model.Loan.getLoanStatus ( )

Gets the status of the loan.

Returns
The status of the loan.

Definition at line 255 of file Loan.java.

◆ getObservations()

String com.student_loan.model.Loan.getObservations ( )

Gets additional observations or comments about the loan.

Returns
Additional observations or comments about the loan.

Definition at line 291 of file Loan.java.

◆ getRating()

Double com.student_loan.model.Loan.getRating ( )

Gets the rating given for the loan transaction.

Returns
The rating given for the loan transaction.

Definition at line 273 of file Loan.java.

◆ getRealReturnDate()

Date com.student_loan.model.Loan.getRealReturnDate ( )

Gets the actual return date for the loaned item.

Returns
The actual return date for the loaned item.

Definition at line 234 of file Loan.java.

◆ setBorrower()

void com.student_loan.model.Loan.setBorrower ( Long  borrower)

Sets the ID of the borrower associated with the loan.

Parameters
borrowerThe ID of the borrower.

Definition at line 168 of file Loan.java.

◆ setEstimatedReturnDate()

void com.student_loan.model.Loan.setEstimatedReturnDate ( Date  estimatedReturnDate)

Sets the estimated return date for the loaned item.

Parameters
estimatedReturnDateThe estimated return date for the loaned item.

Definition at line 225 of file Loan.java.

◆ setId()

void com.student_loan.model.Loan.setId ( Long  id)

Sets the unique identifier for the loan.

Parameters
idThe unique identifier for the loan.

Definition at line 132 of file Loan.java.

◆ setItem()

void com.student_loan.model.Loan.setItem ( Long  item)

Sets the ID of the item being loaned.

Parameters
itemThe ID of the item being loaned.

Definition at line 186 of file Loan.java.

◆ setLender()

void com.student_loan.model.Loan.setLender ( Long  lender)

Sets the ID of the lender associated with the loan.

Parameters
lenderThe ID of the lender.

Definition at line 150 of file Loan.java.

◆ setLoanDate()

void com.student_loan.model.Loan.setLoanDate ( Date  loanDate)

Sets the date when the loan was initiated.

Parameters
loanDateThe date when the loan was initiated.

Definition at line 204 of file Loan.java.

◆ setLoanStatus()

void com.student_loan.model.Loan.setLoanStatus ( Status  loanStatus)

Sets the status of the loan.

Parameters
loanStatusThe status of the loan.

Definition at line 264 of file Loan.java.

◆ setObservations()

void com.student_loan.model.Loan.setObservations ( String  observations)

Sets additional observations or comments about the loan.

Parameters
observationsAdditional observations or comments about the loan.

Definition at line 300 of file Loan.java.

◆ setRating()

void com.student_loan.model.Loan.setRating ( Double  rating)

Sets the rating given for the loan transaction.

Parameters
ratingThe rating given for the loan transaction.

Definition at line 282 of file Loan.java.

◆ setRealReturnDate()

void com.student_loan.model.Loan.setRealReturnDate ( Date  realReturnDate)

Sets the actual return date for the loaned item.

Parameters
realReturnDateThe actual return date for the loaned item.

Definition at line 246 of file Loan.java.

◆ toString()

String com.student_loan.model.Loan.toString ( )

Returns a string representation of the loan.

Returns
A string representation of the loan.

Definition at line 310 of file Loan.java.


The documentation for this class was generated from the following file: