package sg.ncl.service.experiment.web;

import sg.ncl.service.experiment.data.jpa.ExperimentEntity;
import sg.ncl.service.experiment.domain.Experiment;

/**
 * Created by Desmond.
 */
public class ExperimentInfo implements Experiment {

    private Long id;
    private String userId;
    private String teamId;
    private String name;
    private String description;
    private String nsFile;
    private Integer idleSwap;
    private Integer maxDuration;

    public ExperimentInfo(final Long id, final String userId, final String teamId, final String name, final String description, final String nsFile, final Integer idleSwap, final Integer maxDuration) {
        this.id = id;
        this.userId = userId;
        this.teamId = teamId;
        this.name = name;
        this.description = description;
        this.nsFile = nsFile;
        this.idleSwap = idleSwap;
        this.maxDuration = maxDuration;
    }

    public ExperimentInfo(final Experiment experiment) {
        this(experiment.getId(),
                experiment.getUserId(),
                experiment.getTeamId(),
                experiment.getName(),
                experiment.getDescription(),
                experiment.getNsFile(),
                experiment.getIdleSwap(),
                experiment.getMaxDuration());
    }

    public ExperimentInfo(final ExperimentEntity experimentEntity) {
        this(experimentEntity.getId(),
                experimentEntity.getUserId(),
                experimentEntity.getTeamId(),
                experimentEntity.getName(),
                experimentEntity.getDescription(),
                experimentEntity.getNsFile(),
                experimentEntity.getIdleSwap(),
                experimentEntity.getMaxDuration());
    }

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public String getUserId() {
        return userId;
    }

    @Override
    public String getTeamId() {
        return teamId;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public String getNsFile() {
        return nsFile;
    }

    @Override
    public Integer getIdleSwap() {
        return idleSwap;
    }

    @Override
    public Integer getMaxDuration() {
        return maxDuration;
    }
}

@@ -451,16 +451,51 @@
 uration;
+%0A    private String nsFileContents;
 %0A%0A    pu
@@ -589,16 +589,42 @@
 ng name,
+%0A                         
  final S
@@ -690,34 +690,89 @@
 wap,
- final Integer maxDuration
+%0A                          final Integer maxDuration, final String nsFileContents
 ) %7B%0A
@@ -1019,24 +1019,70 @@
 axDuration;%0A
+        this.nsFileContents = nsFileContents;%0A
     %7D%0A%0A    p
@@ -1446,32 +1446,54 @@
 getMaxDuration()
+,%0A                null
 );%0A    %7D%0A%0A    pu
@@ -1924,16 +1924,38 @@
 ration()
+,%0A                null
 );%0A    %7D
@@ -2574,11 +2574,89 @@
 n;%0A    %7D
+%0A%0A    public String getNsFileContents() %7B%0A        return nsFileContents;%0A    %7D
 %0A%7D%0A

Add ns file contents to ExperimentInfo