]> git.basschouten.com Git - openhab-addons.git/blob
8d52a2fd6e369e863b3cfcf62f62febc176abc1e
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.meteoalerte.internal.json;
14
15 import java.time.ZonedDateTime;
16 import java.util.Optional;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20
21 import com.google.gson.annotations.SerializedName;
22
23 /**
24  * The {@link ResponseFieldDTO} is the Java class used to map the JSON
25  * response to the webservice request.
26  *
27  * @author GaĆ«l L'hopital - Initial contribution
28  */
29 @NonNullByDefault
30 public class ResponseFieldDTO {
31     public enum AlertLevel {
32         @SerializedName("Vert")
33         GREEN("00ff00"),
34         @SerializedName("Jaune")
35         YELLOW("ffff00"),
36         @SerializedName("Orange")
37         ORANGE("ef6c00"),
38         @SerializedName("Rouge")
39         RED("ff0000"),
40         UNKNOWN("3d3c3c");
41
42         public final String color;
43
44         AlertLevel(String color) {
45             this.color = color;
46         }
47     }
48
49     @SerializedName("nom_reg")
50     private String nomReg = "";
51     @SerializedName("typeprev")
52     private String typePrev = "";
53     @SerializedName("etat_canicule")
54     private AlertLevel canicule = AlertLevel.UNKNOWN;
55     @SerializedName("nom_dept")
56     private String nomDept = "";
57     @SerializedName("etat_grand_froid")
58     private AlertLevel grandFroid = AlertLevel.UNKNOWN;
59     @SerializedName("noversion")
60     private String noVersion = "";
61     @SerializedName("etat_pluie_inondation")
62     private AlertLevel pluieInondation = AlertLevel.UNKNOWN;
63     @SerializedName("etat_neige")
64     private AlertLevel neige = AlertLevel.UNKNOWN;
65     @SerializedName("etat_vent")
66     private AlertLevel vent = AlertLevel.UNKNOWN;
67     @SerializedName("etat_inondation")
68     private AlertLevel inondation = AlertLevel.UNKNOWN;
69     @SerializedName("etat_avalanches")
70     private AlertLevel avalanches = AlertLevel.UNKNOWN;
71     @SerializedName("etat_orage")
72     private AlertLevel orage = AlertLevel.UNKNOWN;
73     private int echeance;
74     @SerializedName("etat_vague_submersion")
75     private AlertLevel vagueSubmersion = AlertLevel.UNKNOWN;
76     private String dep = "";
77     @SerializedName("vigilancecommentaire_texte")
78     private String vigilanceComment = "";
79     @SerializedName("dateprevue")
80     private @Nullable ZonedDateTime datePrevue;
81     @SerializedName("dateinsert")
82     private @Nullable ZonedDateTime dateInsert;
83     @SerializedName("daterun")
84     private @Nullable ZonedDateTime dateRun;
85
86     public String getVigilanceComment() {
87         return vigilanceComment;
88     }
89
90     public String getNomReg() {
91         return nomReg;
92     }
93
94     public Optional<ZonedDateTime> getDatePrevue() {
95         return Optional.ofNullable(datePrevue);
96     }
97
98     public String getTypePrev() {
99         return typePrev;
100     }
101
102     public AlertLevel getCanicule() {
103         return canicule;
104     }
105
106     public String getNomDept() {
107         return nomDept;
108     }
109
110     public AlertLevel getGrandFroid() {
111         return grandFroid;
112     }
113
114     public String getNoVersion() {
115         return noVersion;
116     }
117
118     public AlertLevel getPluieInondation() {
119         return pluieInondation;
120     }
121
122     public AlertLevel getNeige() {
123         return neige;
124     }
125
126     public AlertLevel getVent() {
127         return vent;
128     }
129
130     public Optional<ZonedDateTime> getDateInsert() {
131         return Optional.ofNullable(dateInsert);
132     }
133
134     public AlertLevel getInondation() {
135         return inondation;
136     }
137
138     public AlertLevel getAvalanches() {
139         return avalanches;
140     }
141
142     public AlertLevel getOrage() {
143         return orage;
144     }
145
146     public int getEcheance() {
147         return echeance;
148     }
149
150     public AlertLevel getVagueSubmersion() {
151         return vagueSubmersion;
152     }
153
154     public String getDep() {
155         return dep;
156     }
157
158     public Optional<ZonedDateTime> getDateRun() {
159         return Optional.ofNullable(dateRun);
160     }
161 }