]> git.basschouten.com Git - openhab-addons.git/blob
e7f6db0c86da5cfee4e07072b23de2a2e4805205
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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         UNKNOWN,
33         @SerializedName("Vert")
34         GREEN,
35         @SerializedName("Jaune")
36         YELLOW,
37         @SerializedName("Orange")
38         ORANGE,
39         @SerializedName("Rouge")
40         RED;
41     }
42
43     @SerializedName("nom_reg")
44     private String nomReg = "";
45     @SerializedName("typeprev")
46     private String typePrev = "";
47     @SerializedName("etat_canicule")
48     private AlertLevel canicule = AlertLevel.UNKNOWN;
49     @SerializedName("nom_dept")
50     private String nomDept = "";
51     @SerializedName("etat_grand_froid")
52     private AlertLevel grandFroid = AlertLevel.UNKNOWN;;
53     @SerializedName("noversion")
54     private String noVersion = "";
55     @SerializedName("etat_pluie_inondation")
56     private AlertLevel pluieInondation = AlertLevel.UNKNOWN;;
57     @SerializedName("etat_neige")
58     private AlertLevel neige = AlertLevel.UNKNOWN;;
59     @SerializedName("etat_vent")
60     private AlertLevel vent = AlertLevel.UNKNOWN;;
61     @SerializedName("etat_inondation")
62     private AlertLevel inondation = AlertLevel.UNKNOWN;;
63     @SerializedName("etat_avalanches")
64     private AlertLevel avalanches = AlertLevel.UNKNOWN;;
65     @SerializedName("etat_orage")
66     private AlertLevel orage = AlertLevel.UNKNOWN;
67     private int echeance;
68     @SerializedName("etat_vague_submersion")
69     private AlertLevel vagueSubmersion = AlertLevel.UNKNOWN;;
70     private String dep = "";
71     @SerializedName("vigilancecommentaire_texte")
72     private String vigilanceComment = "";
73     @SerializedName("dateprevue")
74     private @Nullable ZonedDateTime datePrevue;
75     @SerializedName("dateinsert")
76     private @Nullable ZonedDateTime dateInsert;
77     @SerializedName("daterun")
78     private @Nullable ZonedDateTime dateRun;
79
80     public String getVigilanceComment() {
81         return vigilanceComment;
82     }
83
84     public String getNomReg() {
85         return nomReg;
86     }
87
88     public Optional<ZonedDateTime> getDatePrevue() {
89         return Optional.ofNullable(datePrevue);
90     }
91
92     public String getTypePrev() {
93         return typePrev;
94     }
95
96     public AlertLevel getCanicule() {
97         return canicule;
98     }
99
100     public String getNomDept() {
101         return nomDept;
102     }
103
104     public AlertLevel getGrandFroid() {
105         return grandFroid;
106     }
107
108     public String getNoVersion() {
109         return noVersion;
110     }
111
112     public AlertLevel getPluieInondation() {
113         return pluieInondation;
114     }
115
116     public AlertLevel getNeige() {
117         return neige;
118     }
119
120     public AlertLevel getVent() {
121         return vent;
122     }
123
124     public Optional<ZonedDateTime> getDateInsert() {
125         return Optional.ofNullable(dateInsert);
126     }
127
128     public AlertLevel getInondation() {
129         return inondation;
130     }
131
132     public AlertLevel getAvalanches() {
133         return avalanches;
134     }
135
136     public AlertLevel getOrage() {
137         return orage;
138     }
139
140     public int getEcheance() {
141         return echeance;
142     }
143
144     public AlertLevel getVagueSubmersion() {
145         return vagueSubmersion;
146     }
147
148     public String getDep() {
149         return dep;
150     }
151
152     public Optional<ZonedDateTime> getDateRun() {
153         return Optional.ofNullable(dateRun);
154     }
155 }