]> git.basschouten.com Git - openhab-addons.git/blob
73b756658cb6512dda54862d680572279810a31e
[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.io.hueemulation.internal.dto.changerequest;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Commands are http request data (method+url+body) used by schedules and rules.
19  * <p>
20  * Note: Rules use shorter address variants without the "/api/username" parts, which
21  * makes them no valid relative urls!
22  *
23  * @author David Graeff - Initial contribution
24  */
25 @NonNullByDefault
26 public class HueCommand {
27     public String address = "";
28     public String method = "";
29     public String body = "";
30
31     public boolean isValid() {
32         return !address.isEmpty() && !method.isEmpty() && !body.isEmpty();
33     }
34
35     public HueCommand() {
36     }
37
38     public HueCommand(String address, String method, String body) {
39         this.address = address;
40         this.method = method;
41         this.body = body;
42     }
43 }