]> git.basschouten.com Git - openhab-addons.git/blob
2ee8fe1beb8a15911edb2756eff30590f1d926a7
[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.velux.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18
19 /**
20  * This represents the configuration of an openHAB item that is binded to a Velux
21  * KLF200 Gateway. It contains the following information:
22  *
23  * <ul>
24  * <li><B>bindingItemType</B>
25  * <P>
26  * Accessible via
27  * {@link org.openhab.binding.velux.internal.VeluxBindingConfig#getBindingItemType
28  * getBindingItemType} as representation of the Velux device is filed in the Velux bridge.</li>
29  * <li><B>bindingConfig</B>
30  * <P>
31  * Accessible via
32  * {@link org.openhab.binding.velux.internal.VeluxBindingConfig#getBindingConfig getBindingConfig} containing the
33  * device-specific binding configuration
34  * as declared in the binding configuration (possibly adapted by preprocessing).</li>
35  * </ul>
36  *
37  * @author Guenther Schreiner - Initial contribution
38  */
39 @NonNullByDefault
40 class VeluxBindingConfig {
41
42     private final Logger logger = LoggerFactory.getLogger(VeluxBindingConfig.class);
43
44     /**
45      * The binding type of the velux item described by type {@link org.openhab.binding.velux.internal.VeluxItemType
46      * VeluxItemType}.
47      */
48     private VeluxItemType bindingItemType;
49
50     /**
51      * Device-specific binding configuration as declared in the binding configuration (possibly adapted by
52      * preprocessing).
53      */
54     private String bindingConfig;
55
56     /**
57      * Constructor of the VeluxBindingConfig.
58      *
59      * @param bindingItemType
60      *            The Velux item type {@link org.openhab.binding.velux.internal.VeluxItemType
61      *            VeluxItemType}
62      *            which the Velux device is filed in the Velux bridge.
63      * @param bindingConfig
64      *            The optional configuration type of the Velux binding.
65      */
66     public VeluxBindingConfig(VeluxItemType bindingItemType, String bindingConfig) {
67         logger.trace("VeluxBindingConfig(constructor:{},{}) called.", bindingItemType, bindingConfig);
68
69         this.bindingItemType = bindingItemType;
70         this.bindingConfig = bindingConfig;
71     }
72
73     /**
74      * @return <b>bindingTypeItem</b> of type {@link org.openhab.binding.velux.internal.VeluxItemType
75      *         VeluxItemType}.
76      */
77     public VeluxItemType getBindingItemType() {
78         return this.bindingItemType;
79     }
80
81     /**
82      * @return <b>bindingConfig</b> of type {@link String} that
83      *         has been declared in the binding configuration,
84      *         possibly adapted by preprocessing.
85      */
86     public String getBindingConfig() {
87         return this.bindingConfig;
88     }
89 }