2 * Copyright (c) 2010-2020 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.gardena.internal.model.command;
15 import com.google.gson.annotations.SerializedName;
18 * Base class for a Gardena command with parameters.
20 * @author Gerhard Riegler - Initial contribution
22 public abstract class Command {
24 @SerializedName(value = "name")
25 protected String command;
26 protected CommandParameters parameters;
29 * Creates a command with the given name.
31 public Command(String command) {
32 this.command = command;
36 * Returns the command name.
38 public String getCommand() {
43 * Returns the parameters of the command.
45 public CommandParameters getParameters() {
50 * Sets the parameters of the command.
52 public void setParameters(CommandParameters parameters) {
53 this.parameters = parameters;
57 * Class to hold the command parameters.
59 * @author Gerhard Riegler - Initial contribution
61 public class CommandParameters {
62 private String duration;
63 @SerializedName("manual_override")
64 private String manualOverride;
67 * Returns the duration parameter.
69 public String getDuration() {
74 * Sets the duration parameter.
76 public void setDuration(String duration) {
77 this.duration = duration;
81 * Returns the manual override parameter.
83 public String getManualOverride() {
84 return manualOverride;
88 * Sets the manual override parameter.
90 public void setManualOverride(String manualOverride) {
91 this.manualOverride = manualOverride;