Rework ThingActions (#8755)

* Remove duplication by making use of default Java generated exceptions
* Make ThingActions labels/descriptions more consistent

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2020-10-15 10:53:53 +02:00
committed by GitHub
parent aef1d10f40
commit 978e122e00
40 changed files with 305 additions and 785 deletions

View File

@@ -47,12 +47,8 @@ public class KaleidescapeThingActions implements ThingActions {
}
/** Static alias to support the old DSL rules engine and make the action available there. */
public static void sendKCommand(@Nullable ThingActions actions, String kCommand) throws IllegalArgumentException {
if (actions instanceof KaleidescapeThingActions) {
((KaleidescapeThingActions) actions).sendKCommand(kCommand);
} else {
throw new IllegalArgumentException("Actions is not an instance of KaleidescapeThingActions");
}
public static void sendKCommand(ThingActions actions, String kCommand) throws IllegalArgumentException {
((KaleidescapeThingActions) actions).sendKCommand(kCommand);
}
@Override