1 package org.apache.ojb.broker; 2 3 import java.io.Serializable ; 4 5 9 public class Salad implements InterfaceFood, Serializable 10 { 11 12 int foodId; 13 String name; 14 int calories; 15 String color; 16 19 public Salad() 20 { 21 super(); 22 } 23 24 public Salad(String name, int calories, String color) 25 { 26 this.name = name; 27 this.calories = calories; 28 this.color = color; 29 } 30 31 34 public String getName() 35 { 36 return name; 37 } 38 39 42 public int getCalories() 43 { 44 return calories; 45 } 46 47 48 49 53 public String getColor() 54 { 55 return color; 56 } 57 58 62 public int getFoodId() 63 { 64 return foodId; 65 } 66 67 public String toString() 68 { 69 return "Salad: id = " + foodId + "\n name = " + name + 70 "\n calories = " + calories + 71 "\n Color = " + color; 72 } 73 74 78 public void setCalories(int calories) 79 { 80 this.calories = calories; 81 } 82 83 87 public void setColor(String color) 88 { 89 this.color = color; 90 } 91 92 96 public void setFoodId(int foodId) 97 { 98 this.foodId = foodId; 99 } 100 101 105 public void setName(String name) 106 { 107 this.name = name; 108 } 109 110 } 111 | Popular Tags |