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