Skip to content

Commit

Permalink
Use generics instead of wildcards
Browse files Browse the repository at this point in the history
Signed-off-by: KingSimon <[email protected]>
  • Loading branch information
KingOfSquares committed Apr 16, 2022
1 parent 1ed110f commit d9d5be5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/tc/oc/pgm/api/filter/query/GoalQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import tc.oc.pgm.goals.Goal;
import tc.oc.pgm.goals.GoalDefinition;

public interface GoalQuery extends MatchQuery {
Goal<? extends GoalDefinition> getGoal();
public interface GoalQuery<T extends GoalDefinition> extends MatchQuery {
Goal<T> getGoal();
}
9 changes: 5 additions & 4 deletions core/src/main/java/tc/oc/pgm/filters/query/GoalQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import tc.oc.pgm.goals.Goal;
import tc.oc.pgm.goals.GoalDefinition;

public class GoalQuery extends MatchQuery implements tc.oc.pgm.api.filter.query.GoalQuery {
private final Goal<? extends GoalDefinition> 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<? extends GoalDefinition> goal) {
public GoalQuery(Goal<T> goal) {
super(null, goal.getMatch());
this.goal = goal;
}

@Override
public Goal<? extends GoalDefinition> getGoal() {
public Goal<T> getGoal() {
return this.goal;
}
}

0 comments on commit d9d5be5

Please sign in to comment.