]> git.basschouten.com Git - openhab-addons.git/blob
3a55872cabf6f8157fe0e45545aef17415363dc6
[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.mynice.internal.xml.dto;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNull;
18
19 import com.thoughtworks.xstream.annotations.XStreamAlias;
20 import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
21
22 /**
23  *
24  * @author GaĆ«l L'hopital - Initial contribution
25  */
26 public class Event {
27     @XStreamAsAttribute
28     private String id;
29     @XStreamAsAttribute
30     private String source;
31     @XStreamAsAttribute
32     private String target;
33     @XStreamAsAttribute
34     private String protocolType;
35     @XStreamAsAttribute
36     private String protocolVersion;
37     @XStreamAsAttribute
38     public CommandType type;
39     @XStreamAlias("Error")
40     public Error error;
41
42     @XStreamAlias("Devices")
43     private List<Device> devices;
44
45     public @NonNull List<Device> getDevices() {
46         List<Device> localDevices = devices;
47         return localDevices == null ? List.of() : localDevices;
48     }
49 }