]> git.basschouten.com Git - openhab-addons.git/blob
1f8984d79dcdfd8313b5f0a5e2398fa7e6b37109
[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.solaredge.internal.config;
14
15 import org.apache.commons.lang3.builder.ToStringBuilder;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import org.eclipse.jdt.annotation.Nullable;
18
19 /**
20  * Bean holding configuration data according to bridge.xml
21  *
22  * @author Alexander Friese - initial contribution
23  */
24 @NonNullByDefault
25 public class SolarEdgeConfiguration {
26
27     private @Nullable String tokenOrApiKey;
28     private @Nullable String solarId;
29
30     private boolean meterInstalled = false;
31     private boolean usePrivateApi = false;
32
33     private Integer asyncTimeout = 120;
34     private Integer syncTimeout = 120;
35     private Integer liveDataPollingInterval = 10;
36     private Integer aggregateDataPollingInterval = 60;
37
38     public @Nullable String getTokenOrApiKey() {
39         return tokenOrApiKey;
40     }
41
42     public void setTokenOrApiKey(String tokenOrApiKey) {
43         this.tokenOrApiKey = tokenOrApiKey;
44     }
45
46     public @Nullable String getSolarId() {
47         return solarId;
48     }
49
50     public void setSolarId(String solarId) {
51         this.solarId = solarId;
52     }
53
54     public Integer getAsyncTimeout() {
55         return asyncTimeout;
56     }
57
58     public void setAsyncTimeout(Integer asyncTimeout) {
59         this.asyncTimeout = asyncTimeout;
60     }
61
62     public Integer getSyncTimeout() {
63         return syncTimeout;
64     }
65
66     public void setSyncTimeout(Integer syncTimeout) {
67         this.syncTimeout = syncTimeout;
68     }
69
70     public Integer getLiveDataPollingInterval() {
71         return liveDataPollingInterval;
72     }
73
74     public void setLiveDataPollingInterval(Integer liveDataPollingInterval) {
75         this.liveDataPollingInterval = liveDataPollingInterval;
76     }
77
78     public Integer getAggregateDataPollingInterval() {
79         return aggregateDataPollingInterval;
80     }
81
82     public void setAggregateDataPollingInterval(Integer aggregateDataPollingInterval) {
83         this.aggregateDataPollingInterval = aggregateDataPollingInterval;
84     }
85
86     public boolean isMeterInstalled() {
87         return meterInstalled;
88     }
89
90     public void setMeterInstalled(boolean meterInstalled) {
91         this.meterInstalled = meterInstalled;
92     }
93
94     public boolean isUsePrivateApi() {
95         return usePrivateApi;
96     }
97
98     public void setUsePrivateApi(boolean usePrivateApi) {
99         this.usePrivateApi = usePrivateApi;
100     }
101
102     @Override
103     public String toString() {
104         return new ToStringBuilder(this).append("tokenOrApiKey", getTokenOrApiKey()).append("solarId", getSolarId())
105                 .append("meterInstalled", isMeterInstalled()).append("usePrivateApi", isUsePrivateApi())
106                 .append("live data pollingInterval", getLiveDataPollingInterval())
107                 .append("aggregate data pollingInterval", getAggregateDataPollingInterval())
108                 .append("asyncTimeout", getAsyncTimeout()).append("syncTimeout", getSyncTimeout()).toString();
109     }
110 }