projects
/
rhynodge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Includes the time in the state.
[rhynodge.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
reactor
/
states
/
AbstractState.java
diff --git
a/src/main/java/net/pterodactylus/reactor/states/AbstractState.java
b/src/main/java/net/pterodactylus/reactor/states/AbstractState.java
index
e35c933
..
f8d6f69
100644
(file)
--- a/
src/main/java/net/pterodactylus/reactor/states/AbstractState.java
+++ b/
src/main/java/net/pterodactylus/reactor/states/AbstractState.java
@@
-27,6
+27,9
@@
import net.pterodactylus.reactor.State;
*/
public abstract class AbstractState implements State {
*/
public abstract class AbstractState implements State {
+ /** The time of this state. */
+ private final long time;
+
/** Whether the state was successfully retrieved. */
private final boolean success;
/** Whether the state was successfully retrieved. */
private final boolean success;
@@
-71,6
+74,7
@@
public abstract class AbstractState implements State {
* The exception that occured while retrieving the state
*/
protected AbstractState(boolean success, Throwable exception) {
* The exception that occured while retrieving the state
*/
protected AbstractState(boolean success, Throwable exception) {
+ this.time = System.currentTimeMillis();
this.success = success;
this.exception = exception;
}
this.success = success;
this.exception = exception;
}
@@
-83,6
+87,14
@@
public abstract class AbstractState implements State {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
+ public long time() {
+ return time;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public boolean success() {
return success;
}
public boolean success() {
return success;
}