package net.pterodactylus.rhynodge;
-import net.pterodactylus.rhynodge.output.Output;
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,
- * {@code false} otherwise
+ * @param currentState
+ * The current state of a system
+ * @return The new state, containing a meaningful merge between the previous
+ * and the current state
*/
- boolean triggers(State currentState, State previousState);
+ State mergeStates(State previousState, State currentState);
/**
- * Returns the output of this trigger. This will only return a meaningful
- * value if {@link #triggers(State, State)} returns {@code true}.
+ * Checks whether the states given to {@link #mergeStates(State, State)}
+ * warrant a change trigger.
*
- * @param reaction
- * The reaction being triggered
- * @return The output of this trigger
+ * @return {@code true} if the states given to
+ * {@link #mergeStates(State, State)} warrant a change trigger,
+ * {@code false} otherwise
*/
- Output output(Reaction reaction);
+ boolean triggers();
}