X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Freactor%2FReaction.java;h=65a637bf468faef2471224e3e9e64efb44d7e6e1;hb=b984a8b79ccaec6c2f97cc5c6cca60c6257dad05;hp=59fad8fe8d91b2488685af554fa435eadc2c398b;hpb=bf9e2f0f046ab9b724ca25268668a166afb4c582;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/reactor/Reaction.java b/src/main/java/net/pterodactylus/reactor/Reaction.java index 59fad8f..65a637b 100644 --- a/src/main/java/net/pterodactylus/reactor/Reaction.java +++ b/src/main/java/net/pterodactylus/reactor/Reaction.java @@ -30,6 +30,9 @@ import com.google.common.collect.Lists; */ public class Reaction { + /** The name of this reaction. */ + private final String name; + /** The query to run. */ private final Query query; @@ -48,6 +51,8 @@ public class Reaction { /** * Creates a new reaction. * + * @param name + * The name of the reaction * @param query * The query to run * @param trigger @@ -55,13 +60,15 @@ public class Reaction { * @param action * The action to perform */ - public Reaction(Query query, Trigger trigger, Action action) { - this(query, Collections. emptyList(), trigger, action); + public Reaction(String name, Query query, Trigger trigger, Action action) { + this(name, query, Collections. emptyList(), trigger, action); } /** * Creates a new reaction. * + * @param name + * The name of the reaction * @param query * The query to run * @param filters @@ -71,7 +78,8 @@ public class Reaction { * @param action * The action to perform */ - public Reaction(Query query, List filters, Trigger trigger, Action action) { + public Reaction(String name, Query query, List filters, Trigger trigger, Action action) { + this.name = name; this.query = query; this.filters.addAll(filters); this.trigger = trigger; @@ -83,6 +91,16 @@ public class Reaction { // /** + * Returns the name of this reaction. This name is solely used for display + * purposes and does not need to be unique. + * + * @return The name of this reaction + */ + public String name() { + return name; + } + + /** * Returns the query to run. * * @return The query to run