]> git.basschouten.com Git - openhab-addons.git/blob
c937d7ec46c549e51ac7d3ab33ddf9e454b0154f
[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.miio.internal.miot;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 import com.google.gson.annotations.Expose;
19 import com.google.gson.annotations.SerializedName;
20
21 /**
22  * Mapping properties from json for miot device info
23  *
24  * @author Marcel Verpaalen - Initial contribution
25  */
26 @NonNullByDefault
27 public class OptionsValueDescriptionsListDTO {
28
29     @SerializedName("value")
30     @Expose
31     @Nullable
32     public Integer value;
33     @SerializedName("description")
34     @Expose
35     @Nullable
36     public String description;
37
38     public int getValue() {
39         final Integer val = this.value;
40         return val != null ? val.intValue() : 0;
41     }
42
43     public void setValue(Integer value) {
44         this.value = value;
45     }
46
47     public String getDescription() {
48         final String description = this.description;
49         return description != null ? description : "";
50     }
51
52     public void setDescription(String description) {
53         this.description = description;
54     }
55 }