]> git.basschouten.com Git - openhab-addons.git/blob
0a9a693c22b33ea7bc193f3dec3299497e36fba4
[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.handler.utils;
14
15 import java.util.Map;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.thing.Thing;
20 import org.openhab.core.thing.binding.BaseThingHandler;
21
22 /**
23  * The {@link ExtendedBaseThingHandler} extended the {@link BaseThingHandler} interface and adds <B>publicly
24  * visible</B> convenience methods for property handling.
25  * <p>
26  * It is recommended to extend this abstract base class.
27  * <p>
28  *
29  * @author Guenther Schreiner - Initial contribution.
30  */
31 @NonNullByDefault
32 public abstract class ExtendedBaseThingHandler extends BaseThingHandler {
33
34     /*
35      * ************************
36      * ***** Constructors *****
37      */
38
39     /**
40      * @see BaseThingHandler
41      * @param thing which will be created.
42      */
43     protected ExtendedBaseThingHandler(Thing thing) {
44         super(thing);
45     }
46
47     /**
48      * Returns a copy of the properties map, that can be modified. The method {@link #updateProperties} must be called
49      * to persist the properties.
50      *
51      * @return copy of the thing properties (not null)
52      */
53     @Override
54     public Map<String, String> editProperties() {
55         return super.editProperties();
56     }
57
58     /**
59      * Informs the framework, that the given properties map of the thing was updated. This method performs a check, if
60      * the properties were updated. If the properties did not change, the framework is not informed about changes.
61      *
62      * @param properties properties map, that was updated and should be persisted
63      */
64     @Override
65     public void updateProperties(@Nullable Map<String, String> properties) {
66         super.updateProperties(properties);
67     }
68 }