]> git.basschouten.com Git - openhab-addons.git/blob
f6645781dc5afeb28749b0ca19daca90a47fead9
[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.unifi.internal.api.dto;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import com.google.gson.annotations.Expose;
19
20 /**
21  * The {@link UniFiPortOverrides} represents the data model of UniFi port overrides.
22  *
23  * @author Hilbrand Bouwkamp - Initial contribution
24  */
25 public class UniFiPortOverrides {
26
27     @Expose
28     private final List<UnfiPortOverride> portOverrides = new ArrayList<>();
29
30     public void addPortOverride(final UnfiPortOverride unfiPortOverride) {
31         portOverrides.add(unfiPortOverride);
32     }
33
34     public void addPortOverride(final int portIdx, final String portconfId, final String poeMode) {
35         portOverrides.add(new UnfiPortOverride(portIdx, portconfId, poeMode));
36     }
37
38     @Override
39     public String toString() {
40         return String.format("UniFiPortOverrides: {}", String.join(", ", portOverrides.toArray(new String[0])));
41     }
42 }