]> git.basschouten.com Git - openhab-addons.git/blob
e99f3f045e5949b9e8696086ba143bbcb49adc1a
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.fronius.internal.api;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link Head} is responsible for storing
19  * the "head" node of the JSON response from the Fronius Solar APIs (V1)
20  *
21  * The contents of the response object will vary depending on the preceding request but it always contains a common
22  * response header and a request body.
23  *
24  * @author Thomas Rokohl - Initial contribution
25  */
26 public class Head {
27     @SerializedName("RequestArguments")
28     private HeadRequestArguments requestArguments;
29     @SerializedName("Status")
30     private HeadStatus status;
31     @SerializedName("Timestamp")
32     private String timestamp;
33
34     public HeadRequestArguments getRequestArguments() {
35         if (requestArguments == null) {
36             requestArguments = new HeadRequestArguments();
37         }
38         return requestArguments;
39     }
40
41     public void setRequestArguments(HeadRequestArguments requestArguments) {
42         this.requestArguments = requestArguments;
43     }
44
45     public HeadStatus getStatus() {
46         if (status == null) {
47             status = new HeadStatus();
48             status.setCode(255);
49             status.setReason("undefined runtime error");
50         }
51         return status;
52     }
53
54     public void setStatus(HeadStatus status) {
55         this.status = status;
56     }
57
58     public String getTimestamp() {
59         if (timestamp == null) {
60             timestamp = "";
61         }
62         return timestamp;
63     }
64
65     public void setTimestamp(String timestamp) {
66         this.timestamp = timestamp;
67     }
68 }