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