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.livisismarthome.internal.client.api.entity.action;
15 import org.openhab.binding.livisismarthome.internal.client.api.entity.link.LinkDTO;
18 * Implements the Action structure needed to send JSON actions to the LIVISI backend. They are used to e.g. switch the
21 * @author Oliver Kuhl - Initial contribution
23 public class ActionDTO {
25 private static final String NAMESPACE_CORE_RWE = "core.RWE";
28 * Specifies the type of the action.
33 * Link to the entity supposed to execute the action.
35 private String target;
38 * The product (context) that should handle (execute) the action. Defaults to {@link ActionDTO#NAMESPACE_CORE_RWE}.
40 private String namespace = NAMESPACE_CORE_RWE;
43 * Dictionary of functions required for the intended execution of the action.
45 private ActionParamsDTO params;
48 * Default constructor, used by serialization.
51 // used by serialization
57 public String getType() {
62 * @param type the type to set
64 public void setType(String type) {
69 * @return the link to the target capability
71 public String getTarget() {
76 * @param target the link to the target capability to set
78 public void setTarget(String target) {
83 * @return the namespace
85 public String getNamespace() {
90 * @param namespace the namespace to set
92 public void setNamespace(String namespace) {
93 this.namespace = namespace;
97 * Sets the link target to the given capability id.
99 * @param capabilityId String with the 32 character long id
101 public void setTargetCapabilityById(String capabilityId) {
102 setTarget(LinkDTO.LINK_TYPE_CAPABILITY + capabilityId);
108 public ActionParamsDTO getParams() {
113 * @param params the params to set
115 public void setParams(ActionParamsDTO params) {
116 this.params = params;