]> git.basschouten.com Git - openhab-addons.git/blob
c785869a77727a4e3e7588be880aa150897a9dbd
[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.denonmarantz.internal.xml.entities.commands;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlRootElement;
22
23 /**
24  * Wrapper for a list of {@link CommandTx}
25  *
26  * @author Jeroen Idserda - Initial contribution
27  */
28 @XmlRootElement(name = "tx")
29 @XmlAccessorType(XmlAccessType.FIELD)
30 public class AppCommandRequest {
31
32     @XmlElement(name = "cmd")
33     private List<CommandTx> commands = new ArrayList<>();
34
35     public AppCommandRequest() {
36     }
37
38     public List<CommandTx> getCommands() {
39         return commands;
40     }
41
42     public void setCommands(List<CommandTx> commands) {
43         this.commands = commands;
44     }
45
46     public AppCommandRequest add(CommandTx command) {
47         commands.add(command);
48         return this;
49     }
50
51     public static AppCommandRequest of(CommandTx command) {
52         AppCommandRequest tx = new AppCommandRequest();
53         return tx.add(command);
54     }
55 }