📄 foodinfo.java
字号:
/*
* FoodInfo.java
*
* Created on 2007年6月17日, 下午11:37
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package dennis;
import java.io.Serializable;
import java.util.Collection;
/**
* 实体类 FoodInfo
*
* @author Administrator
*/
public class FoodInfo implements Serializable {
private String foodId;
private String foodName;
private String storeInfo;
private String foodType;
private String unit;
private String unitPrice;
private Collection<MenuInfo> menuInfoCollection;
/** Creates a new instance of FoodInfo */
public FoodInfo() {
}
/**
* 使用指定的值创建 FoodInfo 的新实例。
* @param foodId,FoodInfo 的 foodId
*/
public FoodInfo(String foodId) {
this.foodId = foodId;
}
/**
* 使用指定的值创建 FoodInfo 的新实例。
* @param foodId,FoodInfo 的 foodId
* @param foodName,FoodInfo 的 foodName
* @param foodType,FoodInfo 的 foodType
*/
public FoodInfo(String foodId, String foodName, String foodType) {
this.foodId = foodId;
this.foodName = foodName;
this.foodType = foodType;
}
/**
* 获取此 FoodInfo 的 foodId。
* @return foodId
*/
public String getFoodId() {
return this.foodId;
}
/**
* 将此 FoodInfo 的 foodId 设置为指定的值。
* @param foodId,新建 foodId
*/
public void setFoodId(String foodId) {
this.foodId = foodId;
}
/**
* 获取此 FoodInfo 的 foodName。
* @return foodName
*/
public String getFoodName() {
return this.foodName;
}
/**
* 将此 FoodInfo 的 foodName 设置为指定的值。
* @param foodName,新建 foodName
*/
public void setFoodName(String foodName) {
this.foodName = foodName;
}
/**
* 获取此 FoodInfo 的 storeInfo。
* @return storeInfo
*/
public String getStoreInfo() {
return this.storeInfo;
}
/**
* 将此 FoodInfo 的 storeInfo 设置为指定的值。
* @param storeInfo,新建 storeInfo
*/
public void setStoreInfo(String storeInfo) {
this.storeInfo = storeInfo;
}
/**
* 获取此 FoodInfo 的 foodType。
* @return foodType
*/
public String getFoodType() {
return this.foodType;
}
/**
* 将此 FoodInfo 的 foodType 设置为指定的值。
* @param foodType,新建 foodType
*/
public void setFoodType(String foodType) {
this.foodType = foodType;
}
/**
* 获取此 FoodInfo 的 unit。
* @return unit
*/
public String getUnit() {
return this.unit;
}
/**
* 将此 FoodInfo 的 unit 设置为指定的值。
* @param unit,新建 unit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* 获取此 FoodInfo 的 unitPrice。
* @return unitPrice
*/
public String getUnitPrice() {
return this.unitPrice;
}
/**
* 将此 FoodInfo 的 unitPrice 设置为指定的值。
* @param unitPrice,新建 unitPrice
*/
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
/**
* 获取此 FoodInfo 的 menuInfoCollection。
* @return menuInfoCollection
*/
public Collection<MenuInfo> getMenuInfoCollection() {
return this.menuInfoCollection;
}
/**
* 将此 FoodInfo 的 menuInfoCollection 设置为指定的值。
* @param menuInfoCollection,新建 menuInfoCollection
*/
public void setMenuInfoCollection(Collection<MenuInfo> menuInfoCollection) {
this.menuInfoCollection = menuInfoCollection;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
@Override
public int hashCode() {
int hash = 0;
hash += (this.foodId != null ? this.foodId.hashCode() : 0);
return hash;
}
/**
* 确定其他对象是否等于此 FoodInfo。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 FoodInfo 对象时,
* 结果才为 <code>true</code>。
* @param 对象,要比较的引用对象
* 如果此对象与参数相同,则 @return <code>true</code>;
* 否则为 <code>false</code>。
*/
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof FoodInfo)) {
return false;
}
FoodInfo other = (FoodInfo)object;
if (this.foodId != other.foodId && (this.foodId == null || !this.foodId.equals(other.foodId))) return false;
return true;
}
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
@Override
public String toString() {
return "javaapplication5.FoodInfo[foodId=" + foodId + "]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -