]> git.basschouten.com Git - openhab-addons.git/blob
d4183e6ea955bb7b648d35670203eb2312c462e5
[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.netatmo.internal.api.dto;
14
15 import java.util.Optional;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.netatmo.internal.deserialization.NAObjectMap;
20
21 /**
22  * The {@link Device} holds common data for all Netatmo devices.
23  *
24  * @author GaĆ«l L'hopital - Initial contribution
25  *
26  */
27 @NonNullByDefault
28 public class Device extends NAThing {
29     private @Nullable NAObjectMap<Module> modules;
30     private long dateSetup;
31     private long lastUpgrade;
32     private @Nullable Place place;
33
34     public NAObjectMap<Module> getModules() {
35         NAObjectMap<Module> localModules = modules;
36         return localModules != null ? localModules : new NAObjectMap<>();
37     }
38
39     public long getDateSetup() {
40         return dateSetup;
41     }
42
43     public long getLastUpgrade() {
44         return lastUpgrade;
45     }
46
47     public Optional<Place> getPlace() {
48         return Optional.ofNullable(place);
49     }
50 }