]> git.basschouten.com Git - openhab-addons.git/blob
357d272af9055b741db83a558a6f890e51e047f4
[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.hue.internal.dto.clip2;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.hue.internal.dto.clip2.enums.Archetype;
18
19 import com.google.gson.annotations.SerializedName;
20
21 /**
22  * DTO for CLIP 2 product data.
23  *
24  * @author Andrew Fiddian-Green - Initial contribution
25  */
26 @NonNullByDefault
27 public class ProductData {
28     private @NonNullByDefault({}) @SerializedName("model_id") String modelId;
29     private @NonNullByDefault({}) @SerializedName("manufacturer_name") String manufacturerName;
30     private @NonNullByDefault({}) @SerializedName("product_name") String productName;
31     private @NonNullByDefault({}) @SerializedName("product_archetype") String productArchetype;
32     private @NonNullByDefault({}) Boolean certified;
33     private @NonNullByDefault({}) @SerializedName("software_version") String softwareVersion;
34     private @Nullable @SerializedName("hardware_platform_type") String hardwarePlatformType;
35
36     public String getModelId() {
37         return modelId;
38     }
39
40     public String getManufacturerName() {
41         return manufacturerName;
42     }
43
44     public String getProductName() {
45         return productName;
46     }
47
48     public Archetype getProductArchetype() {
49         return Archetype.of(productArchetype);
50     }
51
52     public Boolean getCertified() {
53         return certified != null ? certified : false;
54     }
55
56     public String getSoftwareVersion() {
57         return softwareVersion != null ? softwareVersion : "";
58     }
59
60     public @Nullable String getHardwarePlatformType() {
61         return hardwarePlatformType;
62     }
63 }