37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package fr.titionfire.ffsaf.rest.data;
|
|
|
|
import fr.titionfire.ffsaf.data.model.MatchModel;
|
|
import fr.titionfire.ffsaf.utils.ScoreEmbeddable;
|
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Data;
|
|
|
|
import java.util.List;
|
|
|
|
@Data
|
|
@AllArgsConstructor
|
|
@RegisterForReflection
|
|
public class MatchData {
|
|
private Long id;
|
|
private Long c1_id;
|
|
private String c1_str;
|
|
private Long c2_id;
|
|
private String c2_str;
|
|
private Long poule;
|
|
private long poule_ord;
|
|
private boolean isEnd = true;
|
|
private char groupe;
|
|
private List<ScoreEmbeddable> scores;
|
|
|
|
public static MatchData fromModel(MatchModel model) {
|
|
if (model == null)
|
|
return null;
|
|
|
|
return new MatchData(model.getSystemId(),
|
|
(model.getC1_id() == null) ? null : model.getC1_id().getId(), model.getC1_str(),
|
|
(model.getC2_id() == null) ? null : model.getC2_id().getId(), model.getC2_str(),
|
|
model.getPoule().getId(), model.getPoule_ord(), model.isEnd(), model.getGroupe(),
|
|
model.getScores());
|
|
}
|
|
}
|