You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
689 B
38 lines
689 B
package de.hs_fulda.ciip.projjpn;
|
|
|
|
public class Item {
|
|
// @ToDo: customerReview
|
|
private String productTitle;
|
|
private String description;
|
|
private int availability = 0;
|
|
private float price;
|
|
|
|
public Item() {
|
|
}
|
|
|
|
public Item(String titel,
|
|
String description,
|
|
int quantity,
|
|
float price) {
|
|
this.productTitle = titel;
|
|
this.description = description;
|
|
this.availability = quantity;
|
|
this.price = price;
|
|
}
|
|
|
|
public boolean inStock() {
|
|
return availability > 0;
|
|
}
|
|
|
|
public void updateAvailability(int newAmount) {
|
|
availability = newAmount;
|
|
}
|
|
|
|
public void updatePrice(float price) {
|
|
this.price = price;
|
|
}
|
|
|
|
public float getCurrentPrice() {
|
|
return price;
|
|
}
|
|
}
|