package org.grjug.bootlab.domain;

import java.time.Instant;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class Launch {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String name;
    private int status;
    private Instant windowStart;  // map to isostart
    private Instant windowEnd;    // map to isoend

    @ManyToOne
    private Location location;

    public Launch() {
    }

    public Launch(String name, LaunchStatus status) {
        this.name = name;
        this.status = status.intValue();
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LaunchStatus getStatusEnum() {
        return LaunchStatus.valueOf(status);
    }
    
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Instant getWindowStart() {
        return windowStart;
    }

    public void setWindowStart(Instant windowStart) {
        this.windowStart = windowStart;
    }

    public Instant getWindowEnd() {
        return windowEnd;
    }

    public void setWindowEnd(Instant windowEnd) {
        this.windowEnd = windowEnd;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return "Launch{"
                + "id=" + id
                + ", name=" + name
                + ", status=" + status 
                + " (" + LaunchStatus.valueOf(status) + ')'
                + ", windowStart=" + windowStart
                + ", windowEnd=" + windowEnd
                + ", location=" + location
                + '}';
    }
}

@@ -400,112 +400,8 @@
 tus;
-%0A    private Instant windowStart;  // map to isostart%0A    private Instant windowEnd;    // map to isoend
 %0A%0A  
@@ -593,37 +593,33 @@
 tValue();%0A    %7D%0A
-    
 %0A
+
     public Long 
@@ -943,13 +943,9 @@
   %7D%0A
-    
 %0A
+
     
@@ -1080,344 +1080,8 @@
  %7D%0A%0A
-    public Instant getWindowStart() %7B%0A        return windowStart;%0A    %7D%0A%0A    public void setWindowStart(Instant windowStart) %7B%0A        this.windowStart = windowStart;%0A    %7D%0A%0A    public Instant getWindowEnd() %7B%0A        return windowEnd;%0A    %7D%0A%0A    public void setWindowEnd(Instant windowEnd) %7B%0A        this.windowEnd = windowEnd;%0A    %7D%0A%0A
     
@@ -1406,17 +1406,16 @@
 + status
- 
 %0A       
@@ -1471,102 +1471,8 @@
 ')'%0A
-                + %22, windowStart=%22 + windowStart%0A                + %22, windowEnd=%22 + windowEnd%0A
     

Remove window start and end. Not going to use these for the lab.