This commit is contained in:
parent
357315990e
commit
0f307eb18c
@ -74,7 +74,10 @@ public class User {
|
|||||||
* @return the statistics
|
* @return the statistics
|
||||||
*/
|
*/
|
||||||
public Map<Date, Statistic> getStatistics(@NonNull Platform.Platforms platform) {
|
public Map<Date, Statistic> getStatistics(@NonNull Platform.Platforms platform) {
|
||||||
return statistics.computeIfAbsent(platform, k -> new HashMap<>());
|
if (this.statistics == null) {
|
||||||
|
this.statistics = new HashMap<>();
|
||||||
|
}
|
||||||
|
return this.statistics.computeIfAbsent(platform, k -> new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,6 +88,6 @@ public class User {
|
|||||||
* @param statistic the statistic to add
|
* @param statistic the statistic to add
|
||||||
*/
|
*/
|
||||||
public void addStatistic(@NonNull Platform.Platforms platform, @NonNull Date date, @NonNull Statistic statistic) {
|
public void addStatistic(@NonNull Platform.Platforms platform, @NonNull Date date, @NonNull Statistic statistic) {
|
||||||
getStatistics(platform).put(date, statistic);
|
this.getStatistics(platform).put(date, statistic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user