01: package org.apache.ojb.broker;
02:
03: import java.io.Serializable;
04:
05: /**
06: * @author <a href="mailto:schneider@mendel.imp.univie.ac.at">Georg Schneider</a>
07: *
08: */
09: public class Salad implements InterfaceFood, Serializable {
10:
11: int foodId;
12: String name;
13: int calories;
14: String color;
15:
16: /**
17: * Constructor for Salad.
18: */
19: public Salad() {
20: super ();
21: }
22:
23: public Salad(String name, int calories, String color) {
24: this .name = name;
25: this .calories = calories;
26: this .color = color;
27: }
28:
29: /**
30: * @see org.apache.ojb.broker.InterfaceFood#getName()
31: */
32: public String getName() {
33: return name;
34: }
35:
36: /**
37: * @see org.apache.ojb.broker.InterfaceFood#getCalories()
38: */
39: public int getCalories() {
40: return calories;
41: }
42:
43: /**
44: * Returns the color.
45: * @return String
46: */
47: public String getColor() {
48: return color;
49: }
50:
51: /**
52: * Returns the foodId.
53: * @return int
54: */
55: public int getFoodId() {
56: return foodId;
57: }
58:
59: public String toString() {
60: return "Salad: id = " + foodId + "\n name = " + name
61: + "\n calories = " + calories + "\n Color = " + color;
62: }
63:
64: /**
65: * Sets the calories.
66: * @param calories The calories to set
67: */
68: public void setCalories(int calories) {
69: this .calories = calories;
70: }
71:
72: /**
73: * Sets the color.
74: * @param color The color to set
75: */
76: public void setColor(String color) {
77: this .color = color;
78: }
79:
80: /**
81: * Sets the foodId.
82: * @param foodId The foodId to set
83: */
84: public void setFoodId(int foodId) {
85: this .foodId = foodId;
86: }
87:
88: /**
89: * Sets the name.
90: * @param name The name to set
91: */
92: public void setName(String name) {
93: this.name = name;
94: }
95:
96: }
|