Sentinel with process jailing using Tomoyo - works with the SmartLightsController...
[iot2.git] / benchmarks / Java / IrrigationController / DayWeather.java
1 package IrrigationController;
2
3 // Standard Java Packages
4 import java.text.SimpleDateFormat;
5 import java.text.ParseException;
6 import java.util.Date;
7
8 /** Class DayWeather to represent the parsed weather data as a compact object.
9  *
10  * @author      Ali Younis <ayounis @ uci.edu>
11  * @version     1.0
12  * @since       2016-03-24
13  */
14 public class DayWeather {
15
16         // enumeration representing the weather conditions
17         public enum WeatherConditions {
18                 THUNDERSTORM_WITH_LIGHT_RAIN,
19                 THUNDERSTORM_WITH_RAIN,
20                 THUNDERSTORM_WITH_HEAVY_RAIN,
21                 LIGHT_THUNDERSTORM,
22                 THUNDERSTORM,
23                 HEAVY_THUNDERSTORM,
24                 RAGGED_THUNDERSTORM,
25                 THUNDERSTORM_WITH_LIGHT_DRIZZLE,
26                 THUNDERSTORM_WITH_DRIZZLE,
27                 THUNDERSTORM_WITH_HEAVY_DRIZZLE,
28                 LIGHT_INTENSITY_DRIZZLE,
29                 DRIZZLE,
30                 HEAVY_INTENSITY_DRIZZLE,
31                 LIGHT_INTENSITY_DRIZZLE_RAIN,
32                 DRIZZLE_RAIN,
33                 HEAVY_INTENSITY_DRIZZLE_RAIN,
34                 SHOWER_RAIN_AND_DRIZZLE,
35                 HEAVY_SHOWER_RAIN_AND_DRIZZLE,
36                 SHOWER_DRIZZLE,
37                 LIGHT_RAIN,
38                 MODERATE_RAIN,
39                 HEAVY_INTENSITY_RAIN,
40                 VERY_HEAVY_RAIN,
41                 EXTREME_RAIN,
42                 FREEZING_RAIN,
43                 LIGHT_INTENSITY_SHOWER_RAIN,
44                 SHOWER_RAIN,
45                 HEAVY_INTENSITY_SHOWER_RAIN,
46                 RAGGED_SHOWER_RAIN,
47                 LIGHT_SNOW,
48                 SNOW,
49                 HEAVY_SNOW,
50                 SLEET,
51                 SHOWER_SLEET,
52                 LIGHT_RAIN_AND_SNOW,
53                 RAIN_AND_SNOW,
54                 LIGHT_SHOWER_SNOW,
55                 SHOWER_SNOW,
56                 HEAVY_SHOWER_SNOW,
57                 MIST,
58                 SMOKE,
59                 HAZE,
60                 SAND_DUST_WHIRLS,
61                 FOG,
62                 SAND,
63                 DUST,
64                 VOLCANIC_ASH,
65                 SQUALLS,
66                 TORNADO,
67                 CLEAR_SKY,
68                 FEW_CLOUDS,
69                 SCATTERED_CLOUDS,
70                 BROKEN_CLOUDS,
71                 OVERCAST_CLOUDS,
72                 TROPICAL_STORM,
73                 COLD,
74                 HOT,
75                 WINDY,
76                 HAIL,
77                 CALM,
78                 LIGHT_BREEZE,
79                 GENTLE_BREEZE,
80                 MODERATE_BREEZE,
81                 FRESH_BREEZE,
82                 STRONG_BREEZE,
83                 HIGH_WIND_NEAR_GALE,
84                 GALE,
85                 SEVERE_GALE,
86                 STORM,
87                 VIOLENT_STORM,
88                 HURRICANE,
89                 UNKNOWN
90         };
91
92
93         /*******************************************************************************************************************************************
94         **
95         **  Variables
96         **
97         *******************************************************************************************************************************************/
98         private Date date = null;
99         private WeatherConditions weatherCondition = WeatherConditions.UNKNOWN;
100
101         // Wind Information
102         private String windDirection = "";
103         private int windDirectionDegrees = 0;                   // In degrees
104         private float windSpeed = 0;                                                    // In Miles per hour
105
106         // Temperature Information
107         private float dayTemperature = 0;                                       // In degrees F
108         private float eveningTemperature = 0;                   // In degrees F
109         private float morningTemperature = 0;                   // In degrees F
110         private float nightTemperature = 0;                             // In degrees F
111         private float maxTemperature = 0;                                       // In degrees F
112         private float minTemperature = 0;                                       // In degrees F
113
114         // Other Information
115         private float pressure = 0;                                             // In hPa
116         private float humidity = 0;                                             // In percent
117         private float cloudPercentage = 0;              // In percent
118
119
120         /** Constructor.
121          *
122          *  @param _date                  [String], String representing the date information for this days weather.
123          *  @param _weatherCondition      [String], String representing the weather condition code information for this days weather.
124          *  @param _windDirection         [String], String representing the wind direction in text format information for this days weather.
125          *  @param _windDirectionDegrees  [String], String representing the wind direction in degrees information for this days weather.
126          *  @param _windSpeed             [String], String representing the wind speed information for this days weather.
127          *  @param _dayTemperature        [String], String representing the day temperature information for this days weather.
128          *  @param _eveningTemperature    [String], String representing the evening temperature information for this days weather.
129          *  @param _morningTemperature    [String], String representing the morning temperature information for this days weather.
130          *  @param _nighttemperature      [String], String representing the night temperature information for this days weather.
131          *  @param _maxTemperature        [String], String representing the max temperature information for this days weather.
132          *  @param _minTemperature        [String], String representing the min temperature information for this days weather.
133          *  @param _pressure              [String], String representing the pressure information for this days weather.
134          *  @param _humidity              [String], String representing the humidity percentage information for this days weather.
135          *  @param _cloudPercentage       [String], String representing the cloud coverage percentage information for this days weather.
136          *
137          */
138         public DayWeather(String _date,
139                                                                                 String _weatherCondition,
140                                                                                 String _windDirection,
141                                                                                 String _windDirectionDegrees,
142                                                                                 String _windSpeed,
143                                                                                 String _dayTemperature,
144                                                                                 String _eveningTemperature,
145                                                                                 String _morningTemperature,
146                                                                                 String _nighttemperature,
147                                                                                 String _maxTemperature,
148                                                                                 String _minTemperature,
149                                                                                 String _pressure,
150                                                                                 String _humidity,
151                                                                                 String _cloudPercentage) {
152
153                 SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
154                 try {
155                         date = formatter.parse(_date);
156                 } catch (ParseException e) {
157                         e.printStackTrace();
158                 }
159
160                 weatherCondition = getWeatherConditionForCode(Integer.parseInt(_weatherCondition));
161
162                 // Wind Variable
163                 windDirection = _windDirection;
164                 windDirectionDegrees = Integer.parseInt(_windDirectionDegrees);
165                 windSpeed = Float.parseFloat(_windSpeed);
166
167                 // Temperature Information
168                 dayTemperature = Float.parseFloat(_dayTemperature);
169                 eveningTemperature = Float.parseFloat(_eveningTemperature);
170                 morningTemperature = Float.parseFloat(_morningTemperature);
171                 nightTemperature = Float.parseFloat(_nighttemperature);
172                 maxTemperature = Float.parseFloat(_maxTemperature);
173                 minTemperature = Float.parseFloat(_minTemperature);
174
175                 // Other Information
176                 pressure = Float.parseFloat(_pressure);
177                 humidity = Float.parseFloat(_humidity);
178                 cloudPercentage = Float.parseFloat(_cloudPercentage);
179         }
180
181
182         /** Method to get the date for this weather object.
183          *
184          *   @return [Date] Date and time for this weather object.
185          */
186         public Date getDate() {
187                 return date;
188         }
189
190
191         /** Method to get the wind direction text (N,NE,S,EXT).
192          *
193          *   @return [String] Wind direction in compass text.
194          */
195         public String getWindDirection() {
196                 return windDirection;
197         }
198
199
200         /** Method to get the wind direction in degrees.
201          *
202          *   @return [int] Wind direction in degrees.
203          */
204         public int getWindDirectionDegrees() {
205                 return windDirectionDegrees;
206         }
207
208
209         /** Method to get the wind speed in miles per hour.
210          *
211          *   @return [float] Wind speed in miles per hour.
212          */
213         public float getWindSpeed() {
214                 return windSpeed;
215         }
216
217
218         /** Method to get the temperature during the day.
219          *
220          *   @return [float] Temperature in degrees F.
221          */
222         public float getDayTemperature() {
223                 return dayTemperature;
224         }
225
226         /** Method to get the temperature during the evening.
227          *
228          *   @return [float] Temperature in degrees F.
229          */
230         public float getEveningTemperature() {
231                 return eveningTemperature;
232         }
233
234
235         /** Method to get the temperature during the morning.
236          *
237          *   @return [float] Temperature in degrees F.
238          */
239         public float getMorningTemperature() {
240                 return morningTemperature;
241         }
242
243
244         /** Method to get the temperature during the night.
245          *
246          *   @return [float] Temperature in degrees F.
247          */
248         public float getNighttemperature() {
249                 return nightTemperature;
250         }
251
252
253         /** Method to get the max temperature.
254          *
255          *   @return [float] Temperature in degrees F.
256          */
257         public float getMaxTemperature() {
258                 return maxTemperature;
259         }
260
261
262         /** Method to get the min temperature.
263          *
264          *   @return [float] Temperature in degrees F.
265          */
266         public float getMinTemperature() {
267                 return minTemperature;
268         }
269
270
271         /** Method to get the pressure.
272          *
273          *   @return [float] Pressure in hPa.
274          */
275         public float getPressure() {
276                 return pressure;
277         }
278
279
280         /** Method to get the humidity.
281          *
282          *   @return [float] Humidity percentage.
283          */
284         public float getHumidity() {
285                 return humidity;
286         }
287
288
289         /** Method to get the cloud coverage percentage.
290          *
291          *   @return [float] Cloud coverage percentage.
292          */
293         public float getCloudPercentage() {
294                 return cloudPercentage;
295         }
296
297
298         /** Method to check if this day is a wet day such as rain or something
299          *
300          *   @return [float] Cloud coverage percentage.
301          */
302         public boolean getIsWetDay() {
303                 if ((weatherCondition == WeatherConditions.THUNDERSTORM_WITH_LIGHT_RAIN) ||
304                                 (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_RAIN) ||
305                                 (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_HEAVY_RAIN) ||
306                                 (weatherCondition == WeatherConditions.LIGHT_THUNDERSTORM) ||
307                                 (weatherCondition == WeatherConditions.THUNDERSTORM) ||
308                                 (weatherCondition == WeatherConditions.HEAVY_THUNDERSTORM) ||
309                                 (weatherCondition == WeatherConditions.RAGGED_THUNDERSTORM) ||
310                                 (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_LIGHT_DRIZZLE) ||
311                                 (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_DRIZZLE) ||
312                                 (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_HEAVY_DRIZZLE) ||
313                                 (weatherCondition == WeatherConditions.LIGHT_INTENSITY_DRIZZLE) ||
314                                 (weatherCondition == WeatherConditions.DRIZZLE) ||
315                                 (weatherCondition == WeatherConditions.HEAVY_INTENSITY_DRIZZLE) ||
316                                 (weatherCondition == WeatherConditions.LIGHT_INTENSITY_DRIZZLE_RAIN) ||
317                                 (weatherCondition == WeatherConditions.DRIZZLE_RAIN) ||
318                                 (weatherCondition == WeatherConditions.HEAVY_INTENSITY_DRIZZLE_RAIN) ||
319                                 (weatherCondition == WeatherConditions.SHOWER_RAIN_AND_DRIZZLE) ||
320                                 (weatherCondition == WeatherConditions.HEAVY_SHOWER_RAIN_AND_DRIZZLE) ||
321                                 (weatherCondition == WeatherConditions.SHOWER_DRIZZLE) ||
322                                 (weatherCondition == WeatherConditions.LIGHT_RAIN) ||
323                                 (weatherCondition == WeatherConditions.MODERATE_RAIN) ||
324                                 (weatherCondition == WeatherConditions.HEAVY_INTENSITY_RAIN) ||
325                                 (weatherCondition == WeatherConditions.VERY_HEAVY_RAIN) ||
326                                 (weatherCondition == WeatherConditions.EXTREME_RAIN) ||
327                                 (weatherCondition == WeatherConditions.FREEZING_RAIN) ||
328                                 (weatherCondition == WeatherConditions.LIGHT_INTENSITY_SHOWER_RAIN) ||
329                                 (weatherCondition == WeatherConditions.SHOWER_RAIN) ||
330                                 (weatherCondition == WeatherConditions.HEAVY_INTENSITY_SHOWER_RAIN) ||
331                                 (weatherCondition == WeatherConditions.RAGGED_SHOWER_RAIN) ||
332                                 (weatherCondition == WeatherConditions.SHOWER_SLEET) ||
333                                 (weatherCondition == WeatherConditions.LIGHT_RAIN_AND_SNOW) ||
334                                 (weatherCondition == WeatherConditions.RAIN_AND_SNOW) ||
335                                 (weatherCondition == WeatherConditions.LIGHT_SHOWER_SNOW) ||
336                                 (weatherCondition == WeatherConditions.SHOWER_SNOW) ||
337                                 (weatherCondition == WeatherConditions.HEAVY_SHOWER_SNOW) ||
338                                 (weatherCondition == WeatherConditions.TORNADO) ||
339                                 (weatherCondition == WeatherConditions.TROPICAL_STORM) ||
340                                 (weatherCondition == WeatherConditions.WINDY) ||
341                                 (weatherCondition == WeatherConditions.HAIL) ||
342                                 (weatherCondition == WeatherConditions.STORM) ||
343                                 (weatherCondition == WeatherConditions.VIOLENT_STORM) ||
344                                 (weatherCondition == WeatherConditions.HURRICANE)) {
345                         return true;
346                 }
347                 return false;
348         }
349
350
351         /** Method to get the string representation of this object.
352          *
353          *   @return [String] String representation of this object.
354          */
355         public String toString() {
356                 String retString = "";
357                 SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
358                 retString += "Forcast for day: " + df.format(date) + "\n";
359                 retString += "\t" + "Weather Condition:" + "\n";
360                 retString += "\t\t" + "Weather Condition: " + getStringforWeatherCondition(weatherCondition) + "\n";
361
362                 // Wind information to string
363                 retString += "\t" + "Wind Information:" + "\n";
364                 retString += "\t\t" + "Wind Direction (Text)   : " + windDirection + "\n";
365                 retString += "\t\t" + "Wind Direction (Degrees): " + Integer.toString(windDirectionDegrees) + "\n";
366                 retString += "\t\t" + "Wind Speed (mph)        : " + Float.toString(windSpeed) + "\n";
367
368                 // Temperature information to string
369                 retString += "\t" + "Temperature Information:" + "\n";
370                 retString += "\t\t" + "Day Temperature (Degrees F)     : " + Float.toString(dayTemperature) + "\n";
371                 retString += "\t\t" + "Evening Temperature (Degrees F) : " + Float.toString(eveningTemperature) + "\n";
372                 retString += "\t\t" + "Morning Temperature (Degrees F) : " + Float.toString(morningTemperature) + "\n";
373                 retString += "\t\t" + "Night Temperature (Degrees F)   : " + Float.toString(nightTemperature) + "\n";
374                 retString += "\t\t" + "Max Temperature (Degrees F)     : " + Float.toString(maxTemperature) + "\n";
375                 retString += "\t\t" + "Min Temperature (Degrees F)     : " + Float.toString(minTemperature) + "\n";
376
377                 // Other information to string
378                 retString += "\t" + "Other Information:" + "\n";
379                 retString += "\t\t" + "Pressure (hPa)     : " + Float.toString(pressure) + "\n";
380                 retString += "\t\t" + "Humidity (Percentage)     : " + Float.toString(humidity) + "\n";
381                 retString += "\t\t" + "Cloud Coverage (Percentage)     : " + Float.toString(cloudPercentage) + "\n";
382
383
384                 return retString;
385         }
386
387
388         /*******************************************************************************************************************************************
389         **
390         **  Helper Methods
391         **
392         *******************************************************************************************************************************************/
393
394         /** Method get the string representation of the weather condition for display.
395          *
396          *   @param cond [WeatherConditions], weather condition code.
397          *
398          *   @return [String] String representation of the weather condition.
399          */
400         private String getStringforWeatherCondition(WeatherConditions cond) {
401                 switch (cond) {
402                 case THUNDERSTORM_WITH_LIGHT_RAIN:
403                         return "THUNDERSTORM_WITH_LIGHT_RAIN";
404
405                 case THUNDERSTORM_WITH_RAIN:
406                         return "THUNDERSTORM_WITH_RAIN";
407
408                 case THUNDERSTORM_WITH_HEAVY_RAIN:
409                         return "THUNDERSTORM_WITH_HEAVY_RAIN";
410
411                 case LIGHT_THUNDERSTORM:
412                         return "LIGHT_THUNDERSTORM";
413
414                 case THUNDERSTORM:
415                         return "THUNDERSTORM";
416
417                 case HEAVY_THUNDERSTORM:
418                         return "HEAVY_THUNDERSTORM";
419
420                 case RAGGED_THUNDERSTORM:
421                         return "RAGGED_THUNDERSTORM";
422
423                 case THUNDERSTORM_WITH_LIGHT_DRIZZLE:
424                         return "THUNDERSTORM_WITH_LIGHT_DRIZZLE";
425
426                 case THUNDERSTORM_WITH_DRIZZLE:
427                         return "THUNDERSTORM_WITH_DRIZZLE";
428
429                 case THUNDERSTORM_WITH_HEAVY_DRIZZLE:
430                         return "THUNDERSTORM_WITH_HEAVY_DRIZZLE";
431
432                 case LIGHT_INTENSITY_DRIZZLE:
433                         return "LIGHT_INTENSITY_DRIZZLE";
434
435                 case DRIZZLE:
436                         return "DRIZZLE";
437
438                 case HEAVY_INTENSITY_DRIZZLE:
439                         return "HEAVY_INTENSITY_DRIZZLE";
440
441                 case LIGHT_INTENSITY_DRIZZLE_RAIN:
442                         return "LIGHT_INTENSITY_DRIZZLE_RAIN";
443
444                 case DRIZZLE_RAIN:
445                         return "DRIZZLE_RAIN";
446
447                 case HEAVY_INTENSITY_DRIZZLE_RAIN:
448                         return "HEAVY_INTENSITY_DRIZZLE_RAIN";
449
450                 case SHOWER_RAIN_AND_DRIZZLE:
451                         return "SHOWER_RAIN_AND_DRIZZLE";
452
453                 case HEAVY_SHOWER_RAIN_AND_DRIZZLE:
454                         return "HEAVY_SHOWER_RAIN_AND_DRIZZLE";
455
456                 case SHOWER_DRIZZLE:
457                         return "SHOWER_DRIZZLE";
458
459                 case LIGHT_RAIN:
460                         return "LIGHT_RAIN";
461
462                 case MODERATE_RAIN:
463                         return "MODERATE_RAIN";
464
465                 case HEAVY_INTENSITY_RAIN:
466                         return "HEAVY_INTENSITY_RAIN";
467
468                 case VERY_HEAVY_RAIN:
469                         return "VERY_HEAVY_RAIN";
470
471                 case EXTREME_RAIN:
472                         return "EXTREME_RAIN";
473
474                 case FREEZING_RAIN:
475                         return "FREEZING_RAIN";
476
477                 case LIGHT_INTENSITY_SHOWER_RAIN:
478                         return "LIGHT_INTENSITY_SHOWER_RAIN";
479
480                 case SHOWER_RAIN:
481                         return "SHOWER_RAIN";
482
483                 case HEAVY_INTENSITY_SHOWER_RAIN:
484                         return "HEAVY_INTENSITY_SHOWER_RAIN";
485
486                 case RAGGED_SHOWER_RAIN:
487                         return "RAGGED_SHOWER_RAIN";
488
489                 case LIGHT_SNOW:
490                         return "LIGHT_SNOW";
491
492                 case SNOW:
493                         return "SNOW";
494
495                 case HEAVY_SNOW:
496                         return "HEAVY_SNOW";
497
498                 case SLEET:
499                         return "SLEET";
500
501                 case SHOWER_SLEET:
502                         return "SHOWER_SLEET";
503
504                 case LIGHT_RAIN_AND_SNOW:
505                         return "LIGHT_RAIN_AND_SNOW";
506
507                 case RAIN_AND_SNOW:
508                         return "RAIN_AND_SNOW";
509
510                 case LIGHT_SHOWER_SNOW:
511                         return "LIGHT_SHOWER_SNOW";
512
513                 case SHOWER_SNOW:
514                         return "SHOWER_SNOW";
515
516                 case HEAVY_SHOWER_SNOW:
517                         return "HEAVY_SHOWER_SNOW";
518
519                 case MIST:
520                         return "MIST";
521
522                 case SMOKE:
523                         return "SMOKE";
524
525                 case HAZE:
526                         return "HAZE";
527
528                 case SAND_DUST_WHIRLS:
529                         return "SAND_DUST_WHIRLS";
530
531                 case FOG:
532                         return "FOG";
533
534                 case SAND:
535                         return "SAND";
536
537                 case DUST:
538                         return "DUST";
539
540                 case VOLCANIC_ASH:
541                         return "VOLCANIC_ASH";
542
543                 case SQUALLS:
544                         return "SQUALLS";
545
546                 case TORNADO:
547                         return "TORNADO";
548
549                 case CLEAR_SKY:
550                         return "CLEAR_SKY";
551
552                 case FEW_CLOUDS:
553                         return "FEW_CLOUDS";
554
555                 case SCATTERED_CLOUDS:
556                         return "SCATTERED_CLOUDS";
557
558                 case BROKEN_CLOUDS:
559                         return "BROKEN_CLOUDS";
560
561                 case OVERCAST_CLOUDS:
562                         return "OVERCAST_CLOUDS";
563
564                 case TROPICAL_STORM:
565                         return "TROPICAL_STORM";
566
567                 case HURRICANE:
568                         return "HURRICANE";
569
570                 case COLD:
571                         return "COLD";
572
573                 case HOT:
574                         return "HOT";
575
576                 case WINDY:
577                         return "WINDY";
578
579                 case HAIL:
580                         return "HAIL";
581
582                 case CALM:
583                         return "CALM";
584
585                 case LIGHT_BREEZE:
586                         return "LIGHT_BREEZE";
587
588                 case GENTLE_BREEZE:
589                         return "GENTLE_BREEZE";
590
591                 case MODERATE_BREEZE:
592                         return "MODERATE_BREEZE";
593
594                 case FRESH_BREEZE:
595                         return "FRESH_BREEZE";
596
597                 case STRONG_BREEZE:
598                         return "STRONG_BREEZE";
599
600                 case HIGH_WIND_NEAR_GALE:
601                         return "HIGH_WIND_NEAR_GALE";
602
603                 case GALE:
604                         return "GALE";
605
606                 case SEVERE_GALE:
607                         return "SEVERE_GALE";
608
609                 case STORM:
610                         return "STORM";
611
612                 case VIOLENT_STORM:
613                         return "VIOLENT_STORM";
614
615                 default:
616                         return "UNKNOWN";
617                 }
618         }
619
620
621         /** Method to change the weather condition code into a WeatherConditions enum type
622          *
623          *   @param cond [int], weather condition code.
624          *
625          *   @return [WeatherConditions] weather conditions enum type.
626          */
627         private WeatherConditions getWeatherConditionForCode(int code) {
628                 switch (code) {
629                 case 200:
630                         return WeatherConditions.THUNDERSTORM_WITH_LIGHT_RAIN;
631
632                 case 201:
633                         return WeatherConditions.THUNDERSTORM_WITH_RAIN;
634
635                 case 202:
636                         return WeatherConditions.THUNDERSTORM_WITH_HEAVY_RAIN;
637
638                 case 210:
639                         return WeatherConditions.LIGHT_THUNDERSTORM;
640
641                 case 211:
642                         return WeatherConditions.THUNDERSTORM;
643
644                 case 212:
645                         return WeatherConditions.HEAVY_THUNDERSTORM;
646
647                 case 221:
648                         return WeatherConditions.RAGGED_THUNDERSTORM;
649
650                 case 230:
651                         return WeatherConditions.THUNDERSTORM_WITH_LIGHT_DRIZZLE;
652
653                 case 231:
654                         return WeatherConditions.THUNDERSTORM_WITH_DRIZZLE;
655
656                 case 232:
657                         return WeatherConditions.THUNDERSTORM_WITH_HEAVY_DRIZZLE;
658
659                 case 300:
660                         return WeatherConditions.LIGHT_INTENSITY_DRIZZLE;
661
662                 case 301:
663                         return WeatherConditions.DRIZZLE;
664
665                 case 302:
666                         return WeatherConditions.HEAVY_INTENSITY_DRIZZLE;
667
668                 case 310:
669                         return WeatherConditions.LIGHT_INTENSITY_DRIZZLE_RAIN;
670
671                 case 311:
672                         return WeatherConditions.DRIZZLE_RAIN;
673
674                 case 312:
675                         return WeatherConditions.HEAVY_INTENSITY_DRIZZLE_RAIN;
676
677                 case 313:
678                         return WeatherConditions.SHOWER_RAIN_AND_DRIZZLE;
679
680                 case 314:
681                         return WeatherConditions.HEAVY_SHOWER_RAIN_AND_DRIZZLE;
682
683                 case 321:
684                         return WeatherConditions.SHOWER_DRIZZLE;
685
686                 case 500:
687                         return WeatherConditions.LIGHT_RAIN;
688
689                 case 501:
690                         return WeatherConditions.MODERATE_RAIN;
691
692                 case 502:
693                         return WeatherConditions.HEAVY_INTENSITY_RAIN;
694
695                 case 503:
696                         return WeatherConditions.VERY_HEAVY_RAIN;
697
698                 case 504:
699                         return WeatherConditions.EXTREME_RAIN;
700
701                 case 511:
702                         return WeatherConditions.FREEZING_RAIN;
703
704                 case 520:
705                         return WeatherConditions.LIGHT_INTENSITY_SHOWER_RAIN;
706
707                 case 521:
708                         return WeatherConditions.SHOWER_RAIN;
709
710                 case 522:
711                         return WeatherConditions.HEAVY_INTENSITY_SHOWER_RAIN;
712
713                 case 531:
714                         return WeatherConditions.RAGGED_SHOWER_RAIN;
715
716                 case 600:
717                         return WeatherConditions.LIGHT_SNOW;
718
719                 case 601:
720                         return WeatherConditions.SNOW;
721
722                 case 602:
723                         return WeatherConditions.HEAVY_SNOW;
724
725                 case 611:
726                         return WeatherConditions.SLEET;
727
728                 case 612:
729                         return WeatherConditions.SHOWER_SLEET;
730
731                 case 615:
732                         return WeatherConditions.LIGHT_RAIN_AND_SNOW;
733
734                 case 616:
735                         return WeatherConditions.RAIN_AND_SNOW;
736
737                 case 620:
738                         return WeatherConditions.LIGHT_SHOWER_SNOW;
739
740                 case 621:
741                         return WeatherConditions.SHOWER_SNOW;
742
743                 case 622:
744                         return WeatherConditions.HEAVY_SHOWER_SNOW;
745
746                 case 701:
747                         return WeatherConditions.MIST;
748
749                 case 711:
750                         return WeatherConditions.SMOKE;
751
752                 case 721:
753                         return WeatherConditions.HAZE;
754
755                 case 731:
756                         return WeatherConditions.SAND_DUST_WHIRLS;
757
758                 case 741:
759                         return WeatherConditions.FOG;
760
761                 case 751:
762                         return WeatherConditions.SAND;
763
764                 case 761:
765                         return WeatherConditions.DUST;
766
767                 case 762:
768                         return WeatherConditions.VOLCANIC_ASH;
769
770                 case 771:
771                         return WeatherConditions.SQUALLS;
772
773                 case 781:
774                         return WeatherConditions.TORNADO;
775
776                 case 800:
777                         return WeatherConditions.CLEAR_SKY;
778
779                 case 801:
780                         return WeatherConditions.FEW_CLOUDS;
781
782                 case 802:
783                         return WeatherConditions.SCATTERED_CLOUDS;
784
785                 case 803:
786                         return WeatherConditions.BROKEN_CLOUDS;
787
788                 case 804:
789                         return WeatherConditions.OVERCAST_CLOUDS;
790
791                 case 900:
792                         return WeatherConditions.TORNADO;
793
794                 case 901:
795                         return WeatherConditions.TROPICAL_STORM;
796
797                 case 902:
798                         return WeatherConditions.HURRICANE;
799
800                 case 903:
801                         return WeatherConditions.COLD;
802
803                 case 904:
804                         return WeatherConditions.HOT;
805
806                 case 905:
807                         return WeatherConditions.WINDY;
808
809                 case 906:
810                         return WeatherConditions.HAIL;
811
812                 case 951:
813                         return WeatherConditions.CALM;
814
815                 case 952:
816                         return WeatherConditions.LIGHT_BREEZE;
817
818                 case 953:
819                         return WeatherConditions.GENTLE_BREEZE;
820
821                 case 954:
822                         return WeatherConditions.MODERATE_BREEZE;
823
824                 case 955:
825                         return WeatherConditions.FRESH_BREEZE;
826
827                 case 956:
828                         return WeatherConditions.STRONG_BREEZE;
829
830                 case 957:
831                         return WeatherConditions.HIGH_WIND_NEAR_GALE;
832
833                 case 958:
834                         return WeatherConditions.GALE;
835
836                 case 959:
837                         return WeatherConditions.SEVERE_GALE;
838
839                 case 960:
840                         return WeatherConditions.STORM;
841
842                 case 961:
843                         return WeatherConditions.VIOLENT_STORM;
844
845                 case 962:
846                         return WeatherConditions.HURRICANE;
847
848                 default:
849                         return WeatherConditions.UNKNOWN;
850                 }
851         }
852 }