mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
133 lines
2.9 KiB
Java
133 lines
2.9 KiB
Java
package com.capstone.foodify.Model;
|
|
|
|
import java.util.List;
|
|
|
|
public class Food implements Comparable<Food>{
|
|
private String id;
|
|
private String name;
|
|
private String description;
|
|
private boolean isEnabled;
|
|
private float discountPercent;
|
|
private float cost;
|
|
private float averageRating;
|
|
private String commentCount;
|
|
private Shop shop;
|
|
private List<Category> categories;
|
|
private List<Image> images;
|
|
public Food() {
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public boolean isEnabled() {
|
|
return isEnabled;
|
|
}
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
isEnabled = enabled;
|
|
}
|
|
|
|
public float getDiscountPercent() {
|
|
return discountPercent;
|
|
}
|
|
|
|
public void setDiscountPercent(float discountPercent) {
|
|
this.discountPercent = discountPercent;
|
|
}
|
|
|
|
public float getCost() {
|
|
return cost;
|
|
}
|
|
|
|
public void setCost(float cost) {
|
|
this.cost = cost;
|
|
}
|
|
|
|
public float getAverageRating() {
|
|
return averageRating;
|
|
}
|
|
|
|
public void setAverageRating(float averageRating) {
|
|
this.averageRating = averageRating;
|
|
}
|
|
|
|
public String getCommentCount() {
|
|
return commentCount;
|
|
}
|
|
|
|
public void setCommentCount(String commentCount) {
|
|
this.commentCount = commentCount;
|
|
}
|
|
|
|
public Shop getShop() {
|
|
return shop;
|
|
}
|
|
|
|
public void setShop(Shop shop) {
|
|
this.shop = shop;
|
|
}
|
|
|
|
public List<Category> getCategories() {
|
|
return categories;
|
|
}
|
|
|
|
public void setCategories(List<Category> categories) {
|
|
this.categories = categories;
|
|
}
|
|
|
|
public List<Image> getImages() {
|
|
return images;
|
|
}
|
|
|
|
public void setImages(List<Image> images) {
|
|
this.images = images;
|
|
}
|
|
|
|
@Override
|
|
public int compareTo(Food food) {
|
|
if(getName().isEmpty() || food.getName().isEmpty()){
|
|
return 0;
|
|
}
|
|
return getName().compareTo(food.getName());
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Food{" +
|
|
"id='" + id + '\'' +
|
|
", name='" + name + '\'' +
|
|
", description='" + description + '\'' +
|
|
", isEnabled=" + isEnabled +
|
|
", discountPercent=" + discountPercent +
|
|
", cost=" + cost +
|
|
", averageRating=" + averageRating +
|
|
", commentCount='" + commentCount + '\'' +
|
|
", shop=" + shop +
|
|
", categories=" + categories +
|
|
", images=" + images +
|
|
'}';
|
|
}
|
|
}
|