From: David ‘Bombe’ Roden Date: Sun, 26 May 2013 15:40:15 +0000 (+0200) Subject: Don’t require overriding valueSet() anymore, a do-nothing default is fine. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=193b778fc4858c36628cd28f775df6c7b26cfed4;p=sonitus.git Don’t require overriding valueSet() anymore, a do-nothing default is fine. --- diff --git a/src/main/java/net/pterodactylus/sonitus/data/controller/AbstractController.java b/src/main/java/net/pterodactylus/sonitus/data/controller/AbstractController.java index b355a89..d81086c 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/controller/AbstractController.java +++ b/src/main/java/net/pterodactylus/sonitus/data/controller/AbstractController.java @@ -113,10 +113,14 @@ public abstract class AbstractController> implements Con * Adjusts the controller. This method is called from {@link * #value(Comparable)} if the new value is different from the current value. * Also, the value is clamped to fit within the range of this controller. + *

+ * This implementation does nothing. * * @param value * The new value */ - protected abstract void valueSet(V value); + protected void valueSet(V value) { + /* do nothing. */ + } } diff --git a/src/main/java/net/pterodactylus/sonitus/data/controller/Fader.java b/src/main/java/net/pterodactylus/sonitus/data/controller/Fader.java index 279da03..c603199 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/controller/Fader.java +++ b/src/main/java/net/pterodactylus/sonitus/data/controller/Fader.java @@ -24,7 +24,7 @@ import net.pterodactylus.sonitus.data.Controller; * * @author David ‘Bombe’ Roden */ -public abstract class Fader extends AbstractController { +public class Fader extends AbstractController { /** * Creates a new fader that is at maximum position. diff --git a/src/main/java/net/pterodactylus/sonitus/data/controller/Switch.java b/src/main/java/net/pterodactylus/sonitus/data/controller/Switch.java index 1b997d4..0de8832 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/controller/Switch.java +++ b/src/main/java/net/pterodactylus/sonitus/data/controller/Switch.java @@ -22,7 +22,7 @@ package net.pterodactylus.sonitus.data.controller; * * @author David ‘Bombe’ Roden */ -public abstract class Switch extends AbstractController { +public class Switch extends AbstractController { /** * Creates a new switch that is off.