2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.meteoalerte.internal.json;
15 import java.time.ZonedDateTime;
16 import java.util.Optional;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.SerializedName;
24 * The {@link ResponseFieldDTO} is the Java class used to map the JSON
25 * response to the webservice request.
27 * @author Gaƫl L'hopital - Initial contribution
30 public class ResponseFieldDTO {
31 public enum AlertLevel {
33 @SerializedName("Vert")
35 @SerializedName("Jaune")
37 @SerializedName("Orange")
39 @SerializedName("Rouge")
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;
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;
80 public String getVigilanceComment() {
81 return vigilanceComment;
84 public String getNomReg() {
88 public Optional<ZonedDateTime> getDatePrevue() {
89 return Optional.ofNullable(datePrevue);
92 public String getTypePrev() {
96 public AlertLevel getCanicule() {
100 public String getNomDept() {
104 public AlertLevel getGrandFroid() {
108 public String getNoVersion() {
112 public AlertLevel getPluieInondation() {
113 return pluieInondation;
116 public AlertLevel getNeige() {
120 public AlertLevel getVent() {
124 public Optional<ZonedDateTime> getDateInsert() {
125 return Optional.ofNullable(dateInsert);
128 public AlertLevel getInondation() {
132 public AlertLevel getAvalanches() {
136 public AlertLevel getOrage() {
140 public int getEcheance() {
144 public AlertLevel getVagueSubmersion() {
145 return vagueSubmersion;
148 public String getDep() {
152 public Optional<ZonedDateTime> getDateRun() {
153 return Optional.ofNullable(dateRun);