* @return {@code true} if this state triggers a change notification,
* {@code false} otherwise
*/
- default boolean triggered() {
- return false;
- }
+ boolean triggered();
+
+ /**
+ * Sets whether this state will trigger a notification.
+ */
+ void trigger();
boolean isEmpty();
@JsonProperty
private final boolean success;
private final boolean empty;
+ private boolean triggered = false;
/** The optional exception that occured while retrieving the state. */
private final Throwable exception;
return empty;
}
+ @Override
+ public boolean triggered() {
+ return triggered;
+ }
+
+ @Override
+ public void trigger() {
+ triggered = true;
+ }
+
/**
* {@inheritDoc}
*/