tests/Java/zh/HotDrinkDecorator.java
2024-06-07 11:47:07 +02:00

17 lines
377 B
Java

// Decorátor
abstract class HotDrinkDecorator extends HotDrink {
HotDrink wrappedObject = null;
public int getBoilingTemperature() {
return wrappedObject.getBoilingTemperature();
}
public String getKeyComponent() {
return wrappedObject.getKeyComponent();
}
public HotDrinkDecorator(HotDrink wo) {
wrappedObject = wo;
}
}