]> git.basschouten.com Git - openhab-addons.git/blob
8ca63574cc741e4fbfdc5ac34eda6902b080ec8b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.homematic.internal.model;
14
15 import org.apache.commons.lang.builder.ToStringBuilder;
16 import org.apache.commons.lang.builder.ToStringStyle;
17
18 /**
19  * Configuration object for sending a datapoint.
20  *
21  * @author Gerhard Riegler - Initial contribution
22  */
23 public class HmDatapointConfig {
24     private Double delay;
25     private Double receiveDelay;
26
27     /**
28      * Returns the delay in seconds for sending the datapoint.
29      */
30     public double getDelay() {
31         return delay == null ? 0.0 : delay;
32     }
33
34     /**
35      * Sets the delay in seconds for sending the datapoint.
36      */
37     public void setDelay(Double delay) {
38         this.delay = delay;
39     }
40
41     /**
42      * Returns the delay in seconds for receiving a new datapoint event.
43      */
44     public Double getReceiveDelay() {
45         return receiveDelay == null ? 0.0 : receiveDelay;
46     }
47
48     /**
49      * Sets the delay in seconds for receiving a datapoint event.
50      */
51     public void setReceiveDelay(Double receiveDelay) {
52         this.receiveDelay = receiveDelay;
53     }
54
55     @Override
56     public String toString() {
57         return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("delay", delay)
58                 .append("receiveDelay", receiveDelay).toString();
59     }
60 }