Getter, Setter hinzugefügt
parent
65577442b0
commit
ccdfafdab0
|
|
@ -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
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue