You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB

package com.car.model;
/**
* 座椅类 - 汽车的组件
* 与Car类是组合关系
*/
public class Seat {
private String type; // 座椅类型 (driver/passenger)
private String material; // 材质
private boolean isAdjustable; // 是否可调节
private boolean hasHeating; // 是否有加热功能
/**
* 构造方法
* @param type 座椅类型
* @param material 材质
* @param isAdjustable 是否可调节
* @param hasHeating 是否有加热功能
*/
public Seat(String type, String material, boolean isAdjustable, boolean hasHeating) {
this.type = type;
this.material = material;
this.isAdjustable = isAdjustable;
this.hasHeating = hasHeating;
}
// getter and setter methods
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public boolean isAdjustable() {
return isAdjustable;
}
public void setAdjustable(boolean isAdjustable) {
this.isAdjustable = isAdjustable;
}
public boolean hasHeating() {
return hasHeating;
}
public void setHasHeating(boolean hasHeating) {
this.hasHeating = hasHeating;
}
@Override
public String toString() {
return "Seat [type=" + type + ", material=" + material + ", isAdjustable=" + isAdjustable + ", hasHeating=" + hasHeating + "]";
}
}