2 * Copyright (c) 2010-2024 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 {
32 @SerializedName("Vert")
34 @SerializedName("Jaune")
36 @SerializedName("Orange")
38 @SerializedName("Rouge")
42 public final String color;
44 AlertLevel(String color) {
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;
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;
86 public String getVigilanceComment() {
87 return vigilanceComment;
90 public String getNomReg() {
94 public Optional<ZonedDateTime> getDatePrevue() {
95 return Optional.ofNullable(datePrevue);
98 public String getTypePrev() {
102 public AlertLevel getCanicule() {
106 public String getNomDept() {
110 public AlertLevel getGrandFroid() {
114 public String getNoVersion() {
118 public AlertLevel getPluieInondation() {
119 return pluieInondation;
122 public AlertLevel getNeige() {
126 public AlertLevel getVent() {
130 public Optional<ZonedDateTime> getDateInsert() {
131 return Optional.ofNullable(dateInsert);
134 public AlertLevel getInondation() {
138 public AlertLevel getAvalanches() {
142 public AlertLevel getOrage() {
146 public int getEcheance() {
150 public AlertLevel getVagueSubmersion() {
151 return vagueSubmersion;
154 public String getDep() {
158 public Optional<ZonedDateTime> getDateRun() {
159 return Optional.ofNullable(dateRun);