|
@@ -0,0 +1,71 @@
|
|
|
+package eu.jovian_hersemeule.dev.squad.squad_composer.data.projections;
|
|
|
+
|
|
|
+import java.time.Instant;
|
|
|
+
|
|
|
+import eu.jovian_hersemeule.dev.squad.squad_composer.data.jpa.SquadEntity;
|
|
|
+
|
|
|
+public class SquadDetails {
|
|
|
+
|
|
|
+ private Long id;
|
|
|
+
|
|
|
+ private PlayerItem player;
|
|
|
+
|
|
|
+ private Instant creationDate;
|
|
|
+
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ private String comment;
|
|
|
+
|
|
|
+ private Integer mech1Id;
|
|
|
+
|
|
|
+ private Integer mech2Id;
|
|
|
+
|
|
|
+ private Integer mech3Id;
|
|
|
+
|
|
|
+ public static SquadDetails project(final SquadEntity entity) {
|
|
|
+ return new SquadDetails(entity);
|
|
|
+ }
|
|
|
+
|
|
|
+ private SquadDetails(final SquadEntity squadEntity) {
|
|
|
+ this.id = squadEntity.getId();
|
|
|
+ this.name = squadEntity.getName();
|
|
|
+ this.comment = squadEntity.getComment();
|
|
|
+ this.player = PlayerItem.project(squadEntity.getPlayer());
|
|
|
+ this.creationDate = squadEntity.getCreationDate().toInstant();
|
|
|
+ this.mech1Id = squadEntity.getMech1Id();
|
|
|
+ this.mech2Id = squadEntity.getMech2Id();
|
|
|
+ this.mech3Id = squadEntity.getMech3Id();
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getId() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PlayerItem getPlayer() {
|
|
|
+ return player;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Instant getCreationDate() {
|
|
|
+ return creationDate;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getComment() {
|
|
|
+ return comment;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getMech1Id() {
|
|
|
+ return mech1Id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getMech2Id() {
|
|
|
+ return mech2Id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getMech3Id() {
|
|
|
+ return mech3Id;
|
|
|
+ }
|
|
|
+}
|