mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 20:59:07 +00:00
26 lines
605 B
Java
26 lines
605 B
Java
package com.iluwatar;
|
|
|
|
public class Hobbits implements WeatherObserver {
|
|
|
|
@Override
|
|
public void update(WeatherType currentWeather) {
|
|
switch (currentWeather) {
|
|
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;
|
|
}
|
|
}
|
|
|
|
}
|