]> git.basschouten.com Git - openhab-addons.git/blob
b28baf2de80c8a98ebd9d060b64758ddf0d415b9
[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.ArrayList;
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The {@code Topology} class defines the dto for Smarther API topology object.
22  *
23  * @author Fabio Possieri - Initial contribution
24  */
25 public class Topology {
26
27     private Plant plant;
28
29     /**
30      * Returns a {@link Plant} object representing the plant contained in this topology.
31      *
32      * @return the plant contained in this topology, or {@code null} if the topology has no plant
33      */
34     public @Nullable Plant getPlant() {
35         return plant;
36     }
37
38     /**
39      * Returns the list of chronothermostat modules contained in this topology.
40      *
41      * @return the list of chronothermostat modules contained in this topology, or an empty list in case the topology
42      *         has no modules
43      */
44     public List<Module> getModules() {
45         return (plant != null) ? plant.getModules() : new ArrayList<>();
46     }
47 }