]> git.basschouten.com Git - openhab-addons.git/blob
637ed2dc5ed679bd7dc24cf9e60339554f34327d
[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 /**
16  * The {@link UniFiPortTable} represents the data model of UniFi port table, which is an extend of port override.
17  *
18  * @author Hilbrand Bouwkamp - Initial contribution
19  */
20 public class UniFiPortTable extends UnfiPortOverride {
21
22     private transient UniFiDevice device;
23
24     private String name;
25
26     private boolean enable;
27
28     private boolean up;
29
30     /**
31      * If true supports PoE.
32      */
33     private boolean portPoe;
34
35     private boolean poeEnable;
36
37     private String poePower;
38
39     private String poeVoltage;
40
41     private String poeCurrent;
42
43     public UniFiDevice getDevice() {
44         return device;
45     }
46
47     public void setDevice(final UniFiDevice device) {
48         this.device = device;
49     }
50
51     public String getName() {
52         return name;
53     }
54
55     public boolean isUp() {
56         return up;
57     }
58
59     public boolean isEnabled() {
60         return enable;
61     }
62
63     public boolean isPortPoe() {
64         return portPoe;
65     }
66
67     public boolean isPoeEnabled() {
68         return poeEnable;
69     }
70
71     public String getPoePower() {
72         return poePower;
73     }
74
75     public String getPoeVoltage() {
76         return poeVoltage;
77     }
78
79     public String getPoeCurrent() {
80         return poeCurrent;
81     }
82
83     @Override
84     public String toString() {
85         return String.format(
86                 "UniFiPortTable{name: '%s', enable: '%b', up: '%b', portPoe: '%b', poeEnable: '%b, poePower: '%s', poeVoltage: '%s', poeCurrent: '%s'}",
87                 name, enable, up, portPoe, poeEnable, poePower, poeVoltage, poeCurrent);
88     }
89 }