Closed Tusharvaghasiya closed 1 year ago
package tacos; import javax.persistence.Entity; import javax.persistence.Id; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @Entity @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PRIVATE, force = true) public class Ingredient { @Id private String id; private String name; private Type type; public enum Type { WRAP, PROTEIN, VEGGIES, CHEESE, SAUCE; public String getType() { switch (this) { case CHEESE: return "cheese"; case PROTEIN: return "protein"; case SAUCE: return "sauce"; case VEGGIES: return "vaggies"; case WRAP: return "wrap"; default: return null; } } } }