|
@ -33,7 +33,8 @@ public class WeatherTrafficProposeUtil { |
|
|
return condition; |
|
|
return condition; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
throw new IllegalArgumentException("No matching WeatherCondition found for level: " + level + " and description: " + description); |
|
|
return null; |
|
|
|
|
|
// throw new IllegalArgumentException("No matching WeatherCondition found for level: " + level + " and description: " + description);
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -111,8 +112,12 @@ public class WeatherTrafficProposeUtil { |
|
|
|
|
|
|
|
|
public static String content(int warningLevelStringNumber, String earlyWarningTypeStringNumber){ |
|
|
public static String content(int warningLevelStringNumber, String earlyWarningTypeStringNumber){ |
|
|
WeatherCondition condition = WeatherCondition.fromLevelAndDescription(warningLevelStringNumber, earlyWarningTypeStringNumber); |
|
|
WeatherCondition condition = WeatherCondition.fromLevelAndDescription(warningLevelStringNumber, earlyWarningTypeStringNumber); |
|
|
|
|
|
if(condition !=null) { |
|
|
System.out.println("Weather Condition: " + condition.name() + ", Level: " + condition.getLevel() + ", Description: " + condition.getDescription()); |
|
|
System.out.println("Weather Condition: " + condition.name() + ", Level: " + condition.getLevel() + ", Description: " + condition.getDescription()); |
|
|
return "建议速度为"+getSpeedLimit(condition) + " km/h ;\n" + getTrafficControlAdvice(condition) + "\n" + getVehicleControlAdvice(condition); |
|
|
return "建议速度为" + getSpeedLimit(condition) + " km/h ;\n" + getTrafficControlAdvice(condition) + "\n" + getVehicleControlAdvice(condition); |
|
|
|
|
|
}else{ |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|