2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.miio.internal.basic;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
18 import com.google.gson.JsonArray;
19 import com.google.gson.JsonElement;
20 import com.google.gson.JsonNull;
21 import com.google.gson.annotations.Expose;
22 import com.google.gson.annotations.SerializedName;
25 * Mapping actions conditions
27 * @author Marcel Verpaalen - Initial contribution
30 public class MiIoDeviceActionCondition {
32 @SerializedName("name")
34 private @Nullable String name;
35 @SerializedName("parameters")
37 private @Nullable JsonElement parameters;
39 public String getName() {
40 final @Nullable String command = this.name;
41 return command != null ? command : "";
44 public void setName(String command) {
48 public JsonElement getParameters() {
49 final JsonElement parameter = this.parameters;
50 return parameter != null ? parameter : JsonNull.INSTANCE;
53 public void setParameters(JsonArray parameters) {
54 this.parameters = parameters;
58 public String toString() {
59 return "MiIoDeviceActionCondition [condition=" + name + ",parameters=" + getParameters().toString() + "]";