/** Whether the state was successfully retrieved. */
private final boolean success;
+ private final boolean empty;
/** The optional exception that occured while retrieving the state. */
private final Throwable exception;
* otherwise
*/
protected AbstractState(boolean success) {
- this(success, null);
+ this(success, true, null);
+ }
+
+ protected AbstractState(boolean success, boolean empty) {
+ this(success, empty, null);
}
/**
* The exception that occured while retrieving the state
*/
protected AbstractState(Throwable exception) {
- this(false, exception);
+ this(false, true, exception);
}
/**
* @param exception
* The exception that occured while retrieving the state
*/
- protected AbstractState(boolean success, Throwable exception) {
+ protected AbstractState(boolean success, boolean empty, Throwable exception) {
this.time = System.currentTimeMillis();
this.success = success;
+ this.empty = empty;
this.exception = exception;
}
return success;
}
+ @Override
+ public boolean isEmpty() {
+ return empty;
+ }
+
/**
* {@inheritDoc}
*/