Don’t require overriding valueSet() anymore, a do-nothing default is fine.
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / controller / Switch.java
index ae815cb..0de8832 100644 (file)
@@ -22,21 +22,28 @@ package net.pterodactylus.sonitus.data.controller;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public abstract class Switch extends AbstractController {
+public class Switch extends AbstractController<Boolean> {
 
-       /** Creates a new switch that is off. */
-       public Switch() {
-               this(false);
+       /**
+        * Creates a new switch that is off.
+        *
+        * @param name
+        *              The name of the switch
+        */
+       public Switch(String name) {
+               this(name, false);
        }
 
        /**
         * Creates a new switch with the given state.
         *
+        * @param name
+        *              The name of the switch
         * @param active
         *              The state of the switch
         */
-       public Switch(boolean active) {
-               super(0, 1, false, active ? 1 : 0);
+       public Switch(String name, boolean active) {
+               super(name, false, true, false, active);
        }
 
 }