]> git.basschouten.com Git - openhab-addons.git/blob
9bc77cc285b21e73997b00424b770f02142d6382
[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.vigicrues.internal.dto.opendatasoft;
14
15 import java.util.Optional;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 import com.google.gson.annotations.SerializedName;
21
22 /**
23  * The {@link Record} is the Java class used to map the JSON
24  * response to the webservice request.
25  *
26  * @author GaĆ«l L'hopital - Initial contribution
27  */
28 @NonNullByDefault
29 public class Record {
30     @SerializedName("datasetid")
31     private String datasetId = "";
32     @SerializedName("recordid")
33     private String recordId = "";
34     @SerializedName("record_timestamp")
35     private String recordTimestamp = "";
36     private @Nullable VigiCruesFields fields;
37
38     public String getDatasetId() {
39         return datasetId;
40     }
41
42     public String getRecordId() {
43         return recordId;
44     }
45
46     public String getRecordTimestamp() {
47         return recordTimestamp;
48     }
49
50     public Optional<VigiCruesFields> getFields() {
51         VigiCruesFields fields = this.fields;
52         if (fields != null) {
53             return Optional.of(fields);
54         }
55         return Optional.empty();
56     }
57 }