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