]> git.basschouten.com Git - openhab-addons.git/blob
703a5fdd024550c06f0b0164055eb675adb8b965
[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.plugwiseha.internal.api.model.dto;
14
15 import com.thoughtworks.xstream.annotations.XStreamAlias;
16 import com.thoughtworks.xstream.annotations.XStreamImplicit;
17
18 /**
19  * @author B. van Wetten - Initial contribution
20  */
21 @XStreamAlias("domain_objects")
22 public class DomainObjects {
23
24     @XStreamAlias("gateway")
25     private GatewayInfo gatewayInfo;
26
27     @XStreamImplicit(itemFieldName = "appliance", keyFieldName = "id")
28     private Appliances appliances = new Appliances();
29
30     @XStreamImplicit(itemFieldName = "location", keyFieldName = "id")
31     private Locations locations = new Locations();
32
33     @SuppressWarnings("unused")
34     @XStreamImplicit(itemFieldName = "module", keyFieldName = "id")
35     private Modules modules = new Modules();
36
37     public GatewayInfo getGatewayInfo() {
38         return gatewayInfo;
39     }
40
41     public Appliances getAppliances() {
42         return appliances;
43     }
44
45     public Locations getLocations() {
46         return locations;
47     }
48
49     public Appliances mergeAppliances(Appliances updatedAppliances) {
50         if (updatedAppliances != null) {
51             this.appliances.merge(updatedAppliances);
52         }
53
54         return this.appliances;
55     }
56
57     public Locations mergeLocations(Locations updatedLocations) {
58         if (updatedLocations != null) {
59             this.locations.merge(updatedLocations);
60         }
61
62         return this.locations;
63     }
64 }