]> git.basschouten.com Git - openhab-addons.git/blob
78f40143a13fe182079fa5604d2592ab990baa63
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.neeo.internal.models;
14
15 import org.apache.commons.lang.StringUtils;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import org.eclipse.jdt.annotation.Nullable;
18
19 /**
20  * The model representing an Neeo Device Details (serialize/deserialize json use only)
21  *
22  * @author Tim Roberts - Initial contribution
23  */
24 @NonNullByDefault
25 public class NeeoDeviceDetails {
26
27     /** The source name (neeo-deviceadapter or sdk name) */
28     @Nullable
29     private String sourceName;
30
31     /** The adapter name (name given by source) */
32     @Nullable
33     private String adapterName;
34
35     /** The NEEO type */
36     @Nullable
37     private String type;
38
39     /** The manufacture */
40     @Nullable
41     private String manufacturer;
42
43     /** The name of the device given by source */
44     @Nullable
45     private String name;
46
47     /** The timings of the device */
48     @Nullable
49     private NeeoDeviceDetailsTiming timing;
50
51     /** The device capabilities */
52     private String @Nullable [] deviceCapabilities;
53
54     /**
55      * The device source name
56      *
57      * @return the device source name
58      */
59     @Nullable
60     public String getSourceName() {
61         return sourceName;
62     }
63
64     /**
65      * The device adapter name (given by the source)
66      *
67      * @return the adapter name
68      */
69     @Nullable
70     public String getAdapterName() {
71         return adapterName;
72     }
73
74     /**
75      * The NEEO device type
76      *
77      * @return the NEEO device type
78      */
79     @Nullable
80     public String getType() {
81         return type;
82     }
83
84     /**
85      * The manufacturer of the device
86      *
87      * @return the manufacturer
88      */
89     @Nullable
90     public String getManufacturer() {
91         return manufacturer;
92     }
93
94     /**
95      * The name of the device (given by the source)
96      *
97      * @return the device name
98      */
99     @Nullable
100     public String getName() {
101         return name;
102     }
103
104     /**
105      * The device timing
106      *
107      * @return the timings
108      */
109     @Nullable
110     public NeeoDeviceDetailsTiming getTiming() {
111         return timing;
112     }
113
114     /**
115      * The device capabilities
116      *
117      * @return the capabilities
118      */
119     public String[] getDeviceCapabilities() {
120         final String[] localCapabilities = deviceCapabilities;
121         return localCapabilities == null ? new String[0] : localCapabilities;
122     }
123
124     @Override
125     public String toString() {
126         return "NeeoDeviceDetails [sourceName=" + sourceName + ", adapterName=" + adapterName + ", type=" + type
127                 + ", manufacturer=" + manufacturer + ", name=" + name + ", timing=" + timing + ", deviceCapabilities="
128                 + StringUtils.join(deviceCapabilities, ',') + "]";
129     }
130 }