Search in sources :

Example 1 with SzScore

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;
}
Also used : SzCategory(com.faendir.zachtronics.bot.sz.model.SzCategory) SzScore(com.faendir.zachtronics.bot.sz.model.SzScore) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SzCategory (com.faendir.zachtronics.bot.sz.model.SzCategory)1 SzScore (com.faendir.zachtronics.bot.sz.model.SzScore)1 NotNull (org.jetbrains.annotations.NotNull)1