Getter, Setter hinzugefügt

Feature-LibraryService
elarturo 2024-11-17 21:45:00 +01:00
parent 65577442b0
commit ccdfafdab0
1 changed files with 42 additions and 9 deletions

View File

@ -9,7 +9,40 @@ public abstract class LibraryItem {
private boolean isLoaned; private boolean isLoaned;
private LocalDate dueDate; private LocalDate dueDate;
// Konstruktor und Getter/Setter public LibraryItem(String id, String title, String author) {
public abstract int getLoanPeriod(); // Unterschiedliche Fristen für Medien this.id = id;
public abstract boolean canRenew(); // Verlängerungsmöglichkeit this.title = title;
this.author = author != null ? author : "-";
this.isLoaned = false;
}
// Getter und Setter
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public boolean isLoaned() {
return isLoaned;
}
public LocalDate getDueDate() {
return dueDate;
}
public void setLoaned(boolean loaned, LocalDate dueDate) {
this.isLoaned = loaned;
this.dueDate = dueDate;
}
public abstract int getLoanPeriod(); // Unterschiedliche Leihfristen
public abstract boolean canRenew(); // Verlängerbarkeit
} }