*/
public class JsonMatches extends JsonCollectionEntity<Match> implements Matches {
+ private static final JsonMatches EMPTY = new JsonMatches(new Match[0]);
+
protected JsonMatches(Match[] entities) {
super(entities);
}
for (Match match : this)
if (match.eventId() == eventId)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override
for (Match match : this)
if (match.eventId() == eventId && match.round() == round)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override
for (Match match : this)
if (match.player1Id() == playerId || match.player2Id() == playerId)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override
for (Match match : this)
if (match.endDate() != null)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override
for (Match match : this)
if (match.startDate() != null && match.endDate() == null)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override
for (Match match : this)
if (match.startDate() == null)
matches.add(match);
- return matches.isEmpty() ? null : new JsonMatches(matches);
+ return matches.isEmpty() ? EMPTY : new JsonMatches(matches);
}
@Override