X-Git-Url: https://git.pterodactylus.net/?p=rhynodge.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2FTrigger.java;h=e4024f2d5d897f686173668424c4ab2854094f8f;hp=3b5a7303290817e15f84766a10ad4f1606aced41;hb=9c01d55d3969a1b3df6529df0c64d4feb146fe4d;hpb=9871b8a902d59f6e8eade050d18c77026b6ecc60 diff --git a/src/main/java/net/pterodactylus/rhynodge/Trigger.java b/src/main/java/net/pterodactylus/rhynodge/Trigger.java index 3b5a730..e4024f2 100644 --- a/src/main/java/net/pterodactylus/rhynodge/Trigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/Trigger.java @@ -31,20 +31,31 @@ import net.pterodactylus.rhynodge.states.FileState; public interface Trigger { /** - * Checks whether the given states warrant a change trigger. + * Merges the current state into the previous state, returning the merged + * state. * - * @param currentState - * The current state of a system * @param previousState * The previous state of the system - * @return {@code true} if the given states warrant a change trigger, + * @param currentState + * The current state of a system + * @return The new state, containing a meaningful merge between the previous + * and the current state + */ + State mergeStates(State previousState, State currentState); + + /** + * Checks whether the states given to {@link #mergeStates(State, State)} + * warrant a change trigger. + * + * @return {@code true} if the states given to + * {@link #mergeStates(State, State)} warrant a change trigger, * {@code false} otherwise */ - boolean triggers(State currentState, State previousState); + boolean triggers(); /** * Returns the output of this trigger. This will only return a meaningful - * value if {@link #triggers(State, State)} returns {@code true}. + * value if {@link #triggers()} returns {@code true}. * * @param reaction * The reaction being triggered