]> git.basschouten.com Git - openhab-addons.git/blob
21bf2289f933659933e8e7ed85a2d0457e46bd3a
[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.miele.internal.api.dto;
14
15 import java.util.Map.Entry;
16
17 import com.google.gson.JsonElement;
18 import com.google.gson.JsonObject;
19
20 /**
21  * The {@link DeviceMetaData} class represents the Metadata node in the response JSON.
22  *
23  * @author Jacob Laursen - Initial contribution
24  */
25 public class DeviceMetaData {
26     public String Filter;
27     public String description;
28     public String LocalizedID;
29     public String LocalizedValue;
30     public JsonObject MieleEnum;
31     public String access;
32
33     public String getMieleEnum(String s) {
34         if (this.MieleEnum == null) {
35             return null;
36         }
37
38         for (Entry<String, JsonElement> enumEntry : this.MieleEnum.entrySet()) {
39             if (enumEntry.getValue().getAsString().trim().equals(s.trim())) {
40                 return enumEntry.getKey();
41             }
42         }
43
44         return null;
45     }
46 }