/*
- * Copyright (c) 2017. Developed by Hedgecode.
+ * Copyright (c) 2017-2020. Developed by Hedgecode.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
public class JsonRankings extends JsonCollectionEntity<Ranking> implements Rankings {
+ private static final JsonRankings EMPTY = new JsonRankings(new Ranking[0]);
+
protected JsonRankings(Ranking[] entities) {
super(entities);
}
for (Ranking ranking : this)
if (ranking.sum() >= minSum && ranking.sum() <= maxSum)
rankings.add(ranking);
- return rankings.isEmpty() ? null : new JsonRankings(rankings);
+ return rankings.isEmpty() ? EMPTY : new JsonRankings(rankings);
}
@Override
RankingComparators.SUM.comparator()
);
}
+
}