use of com.faendir.zachtronics.bot.sz.model.SzScore in project zachtronics-leaderboard-bot by F43nd1r.
the class SzSolution method unmarshal.
@NotNull
public static SzSolution unmarshal(@NotNull String[] fields) {
assert fields.length == 3;
SzScore score = Objects.requireNonNull(SzScore.parseScore(fields[0]));
String author = fields[1];
String categories = fields[2];
SzSolution solution = new SzSolution(score, author);
if (categories != null)
Pattern.compile(",").splitAsStream(categories).map(SzCategory::valueOf).forEach(solution.categories::add);
return solution;
}
Aggregations