]> git.basschouten.com Git - openhab-addons.git/blob
ca79ca8976c0cc493b181e9e635bdee37560c66c
[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.bticinosmarther.internal.api.dto;
14
15 import org.openhab.core.util.StringUtils;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * The {@code Module} class defines the dto for Smarther API chronothermostat module object.
21  *
22  * @author Fabio Possieri - Initial contribution
23  */
24 public class Module {
25
26     @SerializedName("device")
27     private String deviceType;
28     private String id;
29     private String name;
30
31     /**
32      * Returns the device type of the chronothermostat module.
33      *
34      * @return a string containing the module device type
35      */
36     public String getDeviceType() {
37         return StringUtils.capitalizeByWhitespace(deviceType);
38     }
39
40     /**
41      * Returns the identifier of the chronothermostat module.
42      *
43      * @return a string containing the module identifier
44      */
45     public String getId() {
46         return id;
47     }
48
49     /**
50      * Returns the chronothermostat module reference label (i.e. the module "name").
51      *
52      * @return a string containing the module reference label
53      */
54     public String getName() {
55         return name;
56     }
57
58     @Override
59     public String toString() {
60         return String.format("id=%s, name=%s, type=%s", id, name, deviceType);
61     }
62 }