2 * Copyright (c) 2010-2020 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 @SerializedName("nom_reg")
32 private String nomReg = "";
33 @SerializedName("typeprev")
34 private String typePrev = "";
35 @SerializedName("etat_canicule")
36 private String canicule = "";
37 @SerializedName("nom_dept")
38 private String nomDept = "";
39 @SerializedName("etat_grand_froid")
40 private String grandFroid = "";
41 @SerializedName("noversion")
42 private String noVersion = "";
43 @SerializedName("etat_pluie_inondation")
44 private String pluieInondation = "";
45 @SerializedName("etat_neige")
46 private String neige = "";
47 @SerializedName("etat_vent")
48 private String vent = "";
49 @SerializedName("etat_inondation")
50 private String inondation = "";
51 @SerializedName("etat_avalanches")
52 private String avalanches = "";
53 @SerializedName("etat_orage")
54 private String orage = "";
56 @SerializedName("etat_vague_submersion")
57 private String vagueSubmersion = "";
58 private String dep = "";
59 @SerializedName("vigilancecommentaire_texte")
60 private String vigilanceComment = "";
61 @SerializedName("dateprevue")
62 private @Nullable ZonedDateTime datePrevue;
63 @SerializedName("dateinsert")
64 private @Nullable ZonedDateTime dateInsert;
65 @SerializedName("daterun")
66 private @Nullable ZonedDateTime dateRun;
68 public String getVigilanceComment() {
69 return vigilanceComment;
72 public String getNomReg() {
76 public Optional<ZonedDateTime> getDatePrevue() {
77 ZonedDateTime datePrevue = this.datePrevue;
78 if (datePrevue != null) {
79 return Optional.of(datePrevue);
81 return Optional.empty();
84 public String getTypePrev() {
88 public String getCanicule() {
92 public String getNomDept() {
96 public String getGrandFroid() {
100 public String getNoVersion() {
104 public String getPluieInondation() {
105 return pluieInondation;
108 public String getNeige() {
112 public String getVent() {
116 public Optional<ZonedDateTime> getDateInsert() {
117 ZonedDateTime dateInsert = this.dateInsert;
118 if (dateInsert != null) {
119 return Optional.of(dateInsert);
121 return Optional.empty();
124 public String getInondation() {
128 public String getAvalanches() {
132 public String getOrage() {
136 public int getEcheance() {
140 public String getVagueSubmersion() {
141 return vagueSubmersion;
144 public String getDep() {
148 public Optional<ZonedDateTime> getDateRun() {
149 ZonedDateTime dateRun = this.dateRun;
150 if (dateRun != null) {
151 return Optional.of(dateRun);
153 return Optional.empty();