
org.dsa.iot.dslink.methods.requests.SetRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dslink Show documentation
Show all versions of dslink Show documentation
SDK for the IoT DSA protocol
The newest version!
package org.dsa.iot.dslink.methods.requests;
import org.dsa.iot.dslink.methods.Request;
import org.dsa.iot.dslink.node.value.Value;
import org.dsa.iot.dslink.util.json.JsonObject;
/**
* Request used to set a value
*
* @author Samuel Grenier
*/
public class SetRequest extends Request {
private final String path;
private final Value value;
public SetRequest(String path, Value value) {
if (path == null) {
throw new NullPointerException("path");
} else if (value == null) {
throw new NullPointerException("value");
}
this.path = path;
this.value = value;
}
@Override
public String getName() {
return "set";
}
public String getPath() {
return path;
}
@Override
public void addJsonValues(JsonObject out) {
out.put("path", path);
out.put("value", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy