From ed69f6a0e38f458a366d8878203728cac838c0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Mon, 26 Mar 2012 23:02:58 +0200 Subject: [PATCH] removed Devices classes --- .../de/ctdo/bunti/devices/DeviceMixer.java | 9 ---- .../ctdo/bunti/devices/DeviceMixerImpl.java | 25 ----------- .../bunti/model/BuntiSwitchingDevice.java | 41 ------------------- 3 files changed, 75 deletions(-) delete mode 100644 src/main/java/de/ctdo/bunti/devices/DeviceMixer.java delete mode 100644 src/main/java/de/ctdo/bunti/devices/DeviceMixerImpl.java delete mode 100644 src/main/java/de/ctdo/bunti/model/BuntiSwitchingDevice.java diff --git a/src/main/java/de/ctdo/bunti/devices/DeviceMixer.java b/src/main/java/de/ctdo/bunti/devices/DeviceMixer.java deleted file mode 100644 index 71af194..0000000 --- a/src/main/java/de/ctdo/bunti/devices/DeviceMixer.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.ctdo.bunti.devices; - - - -public interface DeviceMixer { - - - -} diff --git a/src/main/java/de/ctdo/bunti/devices/DeviceMixerImpl.java b/src/main/java/de/ctdo/bunti/devices/DeviceMixerImpl.java deleted file mode 100644 index a1345c6..0000000 --- a/src/main/java/de/ctdo/bunti/devices/DeviceMixerImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.ctdo.bunti.devices; - -import de.ctdo.bunti.control.DeviceChangedEvent; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -import de.ctdo.bunti.model.BuntiSwitchingDevice; - - -@Component -public class DeviceMixerImpl implements DeviceMixer, ApplicationListener { - - @Override - public final void onApplicationEvent(DeviceChangedEvent arg0) { - - if( arg0.getDevice() instanceof BuntiSwitchingDevice) { - - BuntiSwitchingDevice switchDev = (BuntiSwitchingDevice)arg0.getDevice(); - switchDev.setValuesFromOptions(arg0.getOptions()); - - } - - } - -} diff --git a/src/main/java/de/ctdo/bunti/model/BuntiSwitchingDevice.java b/src/main/java/de/ctdo/bunti/model/BuntiSwitchingDevice.java deleted file mode 100644 index 293269d..0000000 --- a/src/main/java/de/ctdo/bunti/model/BuntiSwitchingDevice.java +++ /dev/null @@ -1,41 +0,0 @@ -package de.ctdo.bunti.model; - -import javax.persistence.Entity; -import javax.persistence.Transient; -import java.util.Map; - -@Entity -public abstract class BuntiSwitchingDevice extends BuntiDevice { - private static final String OPTION_STATE = "state"; - private boolean state = false; - - public BuntiSwitchingDevice() { - - } - - @Override - public final boolean setValuesFromOptions(Map options) { - - if(options.containsKey(OPTION_STATE)) { - - try { - boolean value = Boolean.parseBoolean(options.get(OPTION_STATE).toString()); - setState(value); - return true; - } catch (Exception e) { - return false; - } - - } - return false; - } - - @Transient - public boolean isState() { - return state; - } - - public void setState(boolean state) { - this.state = state; - } -}