X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Fstates%2FAbstractState.java;h=afb7dc2e51b92d9edd8079a5920ba2cdc5825116;hb=75dffc0a110405807d5e6a6dd9e0815299d894ad;hp=17cd518ded31fff0e3c4274bf5d032e644877837;hpb=6f69aff66ba5617d0bb27874014b4274bc551ab8;p=rhynodge.git 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 --- 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; + private final boolean empty; /** 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) { - 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) { - 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 */ - 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; } @@ -108,6 +114,11 @@ public abstract class AbstractState implements State { return success; } + @Override + public boolean isEmpty() { + return empty; + } + /** * {@inheritDoc} */