X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2FState.java;h=966dbe307927b36a47a2f0b7c87dbc700a9974e5;hb=8aeef90590095a455e2323d70ba8ccae032f4276;hp=fe7f8ea11445649fec3423932ae3d354d087fe60;hpb=6ec36ef950c23c135bf0e112d932c5b7068189b8;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/rhynodge/State.java b/src/main/java/net/pterodactylus/rhynodge/State.java index fe7f8ea..966dbe3 100644 --- a/src/main/java/net/pterodactylus/rhynodge/State.java +++ b/src/main/java/net/pterodactylus/rhynodge/State.java @@ -17,6 +17,10 @@ package net.pterodactylus.rhynodge; +import javax.annotation.Nonnull; + +import net.pterodactylus.rhynodge.output.Output; + /** * Defines the current state of a system. * @@ -44,6 +48,23 @@ public interface State { boolean success(); /** + * Returns whether this state triggers a change notification. This can + * only return {@code true} if this state is the result of a + * {@link Merger} merging two states. + * + * @return {@code true} if this state triggers a change notification, + * {@code false} otherwise + */ + boolean triggered(); + + /** + * Sets whether this state will trigger a notification. + */ + void trigger(); + + boolean isEmpty(); + + /** * Returns the number of consecutive failures. This method only returns a * meaningful number iff {@link #success()} returns {@code false}. If * {@link #success()} returns {@code false} for the first time after @@ -74,4 +95,7 @@ public interface State { */ Throwable exception(); + @Nonnull + Output output(Reaction reaction); + }