projects
/
rhynodge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🎨 Replace QC watcher with Kotlin version
[rhynodge.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
rhynodge
/
states
/
AbstractState.java
diff --git
a/src/main/java/net/pterodactylus/rhynodge/states/AbstractState.java
b/src/main/java/net/pterodactylus/rhynodge/states/AbstractState.java
index
17cd518
..
afb7dc2
100644
(file)
--- a/
src/main/java/net/pterodactylus/rhynodge/states/AbstractState.java
+++ b/
src/main/java/net/pterodactylus/rhynodge/states/AbstractState.java
@@
-37,6
+37,7
@@
public abstract class AbstractState implements State {
/** Whether the state was successfully retrieved. */
private final boolean success;
/** 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;
/** The optional exception that occured while retrieving the state. */
private final Throwable exception;
@@
-60,7
+61,11
@@
public abstract class AbstractState implements State {
* otherwise
*/
protected AbstractState(boolean success) {
* otherwise
*/
protected AbstractState(boolean success) {
- this(success, null);
+ this(success, true, null);
+ }
+
+ protected AbstractState(boolean success, boolean empty) {
+ this(success, empty, null);
}
/**
}
/**
@@
-70,7
+75,7
@@
public abstract class AbstractState implements State {
* The exception that occured while retrieving the state
*/
protected AbstractState(Throwable exception) {
* The exception that occured while retrieving the state
*/
protected AbstractState(Throwable exception) {
- this(false, exception);
+ this(false,
true,
exception);
}
/**
}
/**
@@
-82,9
+87,10
@@
public abstract class AbstractState implements State {
* @param exception
* The exception that occured while retrieving the state
*/
* @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.time = System.currentTimeMillis();
this.success = success;
+ this.empty = empty;
this.exception = exception;
}
this.exception = exception;
}
@@
-108,6
+114,11
@@
public abstract class AbstractState implements State {
return success;
}
return success;
}
+ @Override
+ public boolean isEmpty() {
+ return empty;
+ }
+
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/