48 lines
904 B
Java
48 lines
904 B
Java
package de.ctdo.bunti.model;
|
|
|
|
import java.util.Map;
|
|
|
|
public abstract class BuntiDevice {
|
|
protected int deviceId;
|
|
protected String deviceName;
|
|
private long lastChanged;
|
|
|
|
public int getDeviceId() {
|
|
return deviceId;
|
|
}
|
|
|
|
public long getLastChanged() {
|
|
return lastChanged;
|
|
}
|
|
|
|
protected void lastChangedNow() {
|
|
this.lastChanged = System.currentTimeMillis();
|
|
}
|
|
|
|
public String getDeviceName() {
|
|
return deviceName;
|
|
}
|
|
|
|
public void setDeviceName(String deviceName) {
|
|
this.deviceName = deviceName;
|
|
}
|
|
|
|
/**
|
|
* Switch this device off.
|
|
*/
|
|
public abstract void switchOff();
|
|
|
|
/**
|
|
* Switch this device on.
|
|
*/
|
|
public abstract void switchOn();
|
|
|
|
/**
|
|
* The the internal options corresponding to the given Key Value Map
|
|
* @param options The options Map.
|
|
* @return True on success. False otherwise.
|
|
*/
|
|
public abstract boolean setValuesFromOptions(Map<String, Object> options);
|
|
|
|
}
|