Files
java-design-patterns/observer/src/main/java/com/iluwatar/generic/GHobbits.java
T
2014-11-11 23:15:13 +00:00

26 lines
804 B
Java

package com.iluwatar.generic;
import com.iluwatar.WeatherType;
public class GHobbits implements Race {
@Override
public void update(GWeather o, WeatherType weatherType) {
switch (weatherType) {
case COLD:
System.out.println("The hobbits are shivering in the cold weather.");
break;
case RAINY:
System.out.println("The hobbits look for cover from the rain.");
break;
case SUNNY:
System.out.println("The happy hobbits bade in the warm sun.");
break;
case WINDY:
System.out.println("The hobbits hold their hats tightly in the windy weather.");
break;
default:
break;
}
}
}