mirror of
https://github.com/tommyskeff/futur4j.git
synced 2026-01-18 07:16:45 +00:00
direct listeners concept
This commit is contained in:
@@ -9,29 +9,17 @@ public class PromiseCompletion<T> {
|
||||
|
||||
private @Nullable T result;
|
||||
private @Nullable Throwable exception;
|
||||
private boolean active;
|
||||
|
||||
public PromiseCompletion(@Nullable T result) {
|
||||
this.result = result;
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
public PromiseCompletion(@NotNull Throwable exception) {
|
||||
this.exception = exception;
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
public PromiseCompletion() {
|
||||
this.result = null;
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
public void markHandled() {
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public boolean isError() {
|
||||
|
||||
Reference in New Issue
Block a user