-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add passing of source event to result handler
- Loading branch information
Showing
5 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package dev.shiza.dew.result; | ||
|
||
public interface ResultHandler<T> { | ||
import dev.shiza.dew.event.Event; | ||
|
||
void handle(final T result); | ||
public interface ResultHandler<E extends Event, T> { | ||
|
||
void handle(final E event, final T result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package dev.shiza.dew.result; | ||
|
||
import dev.shiza.dew.event.Event; | ||
|
||
public interface ResultHandlerFacade { | ||
|
||
<T> void register(final Class<T> resultType, final ResultHandler<T> resultHandler); | ||
<E extends Event, T> void register(final Class<T> resultType, final ResultHandler<E, T> resultHandler); | ||
|
||
<T> void process(final T value); | ||
<E extends Event, T> void process(final E event, final T value); | ||
} |
23 changes: 12 additions & 11 deletions
23
dew-common/src/dev/shiza/dew/result/ResultHandlerService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters