-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: KingSimon <[email protected]>
- Loading branch information
1 parent
a200242
commit ea2bb37
Showing
2 changed files
with
16 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package tc.oc.pgm.api.filter.query; | ||
|
||
import tc.oc.pgm.goals.Goal; | ||
import tc.oc.pgm.goals.GoalDefinition; | ||
|
||
public interface GoalQuery<T extends GoalDefinition> extends MatchQuery { | ||
Goal<T> getGoal(); | ||
} |
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,20 +1,23 @@ | ||
package tc.oc.pgm.filters.query; | ||
|
||
import tc.oc.pgm.goals.Goal; | ||
import tc.oc.pgm.goals.GoalDefinition; | ||
|
||
/** | ||
* Currently, the only thing this class does is derive the Match from a Goal. In the future, we may | ||
* have filters that respond specifically to goal queries, but currently we do not. | ||
*/ | ||
public class GoalQuery extends MatchQuery { | ||
private final Goal<?> goal; | ||
public class GoalQuery<T extends GoalDefinition> extends MatchQuery | ||
implements tc.oc.pgm.api.filter.query.GoalQuery<T> { | ||
private final Goal<T> goal; | ||
|
||
public GoalQuery(Goal<?> goal) { | ||
public GoalQuery(Goal<T> goal) { | ||
super(null, goal.getMatch()); | ||
this.goal = goal; | ||
} | ||
|
||
public Goal<?> getGoal() { | ||
return goal; | ||
@Override | ||
public Goal<T> getGoal() { | ||
return this.goal; | ||
} | ||
} |