]> git.basschouten.com Git - openhab-addons.git/blob
d104e6ea363f6473dbdd73d193c6e6bb17773636
[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 java.util.List;
16
17 import org.eclipse.jdt.annotation.Nullable;
18
19 /**
20  * The {@code ModuleStatus} class defines the dto for Smarther API module status object.
21  *
22  * @author Fabio Possieri - Initial contribution
23  */
24 public class ModuleStatus {
25
26     private List<Chronothermostat> chronothermostats;
27
28     /**
29      * Returns the chronothermostat details of this module status.
30      *
31      * @return the chronothermostat details
32      */
33     public List<Chronothermostat> getChronothermostats() {
34         return chronothermostats;
35     }
36
37     /**
38      * Returns the first chronothermostat item contained in this module status.
39      *
40      * @return the first chronothermostat item, or {@code null} in case of no item found
41      */
42     public @Nullable Chronothermostat toChronothermostat() {
43         return (!chronothermostats.isEmpty() && chronothermostats.get(0) != null) ? chronothermostats.get(0) : null;
44     }
45
46     @Override
47     public String toString() {
48         return String.format("chronothermostats=[%s]", chronothermostats);
49     }
50 }