2 * Copyright (c) 2010-2023 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.solaredge.internal.config;
15 import org.apache.commons.lang3.builder.ToStringBuilder;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import org.eclipse.jdt.annotation.Nullable;
20 * Bean holding configuration data according to bridge.xml
22 * @author Alexander Friese - initial contribution
25 public class SolarEdgeConfiguration {
27 private @Nullable String tokenOrApiKey;
28 private @Nullable String solarId;
30 private boolean meterInstalled = false;
31 private boolean usePrivateApi = false;
33 private Integer asyncTimeout = 120;
34 private Integer syncTimeout = 120;
35 private Integer liveDataPollingInterval = 10;
36 private Integer aggregateDataPollingInterval = 60;
38 public @Nullable String getTokenOrApiKey() {
42 public void setTokenOrApiKey(String tokenOrApiKey) {
43 this.tokenOrApiKey = tokenOrApiKey;
46 public @Nullable String getSolarId() {
50 public void setSolarId(String solarId) {
51 this.solarId = solarId;
54 public Integer getAsyncTimeout() {
58 public void setAsyncTimeout(Integer asyncTimeout) {
59 this.asyncTimeout = asyncTimeout;
62 public Integer getSyncTimeout() {
66 public void setSyncTimeout(Integer syncTimeout) {
67 this.syncTimeout = syncTimeout;
70 public Integer getLiveDataPollingInterval() {
71 return liveDataPollingInterval;
74 public void setLiveDataPollingInterval(Integer liveDataPollingInterval) {
75 this.liveDataPollingInterval = liveDataPollingInterval;
78 public Integer getAggregateDataPollingInterval() {
79 return aggregateDataPollingInterval;
82 public void setAggregateDataPollingInterval(Integer aggregateDataPollingInterval) {
83 this.aggregateDataPollingInterval = aggregateDataPollingInterval;
86 public boolean isMeterInstalled() {
87 return meterInstalled;
90 public void setMeterInstalled(boolean meterInstalled) {
91 this.meterInstalled = meterInstalled;
94 public boolean isUsePrivateApi() {
98 public void setUsePrivateApi(boolean usePrivateApi) {
99 this.usePrivateApi = usePrivateApi;
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();