Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.orph2020.pst.common.json;

import java.util.ArrayList;
import java.util.List;

public class OpticalTelescopeClone {
private String proposalID;
private String cloneID;
private List<Long> obsIds;
private List<Long> cloneObsIDs;

public OpticalTelescopeClone(
String proposalID, String cloneID, List<Long> obsIds,
List<Long> cloneObsIDs) {
this.proposalID = proposalID;
this.cloneID = cloneID;
this.obsIds = obsIds;
this.cloneObsIDs = cloneObsIDs;
}

public OpticalTelescopeClone() {}

public String getProposalID() {
return proposalID;
}

public void setProposalID(String proposalID) {
this.proposalID = proposalID;
}

public String getCloneID() {
return cloneID;
}

public void setCloneID(String cloneID) {
this.cloneID = cloneID;
}

public List<Long> getObsIds() {
return obsIds;
}

public void setObsIds(List<Long> obsIds) {
this.obsIds = obsIds;
}

public List<Long> getCloneObsIDs() {
return cloneObsIDs;
}

public void setCloneObsIDs(List<Long> cloneObsIDs) {
this.cloneObsIDs = cloneObsIDs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package org.orph2020.pst.common.json;

import jakarta.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;


@Embeddable
public class OpticalTelescopeDataId implements Serializable {

private String proposalID;
private String observationID;

public OpticalTelescopeDataId() {
}

public OpticalTelescopeDataId(String proposalID, String observationID) {
this.proposalID = proposalID;
this.observationID = observationID;
}

public String getProposalID() {
return proposalID;
}

public void setProposalID(String proposalID) {
this.proposalID = proposalID;
}

public String getObservationID() {
return observationID;
}

public void setObservationID(String observationID) {
this.observationID = observationID;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OpticalTelescopeDataId that = (OpticalTelescopeDataId) o;
return Objects.equals(proposalID, that.proposalID) &&
Objects.equals(observationID, that.observationID);
}

@Override
public int hashCode() {
return Objects.hash(proposalID, observationID);
}

@Override
public String toString() {
return "OpticalTelescopeDataId{" +
"proposalID='" + proposalID + '\'' +
", observationID='" + observationID + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.orph2020.pst.common.json;

// data type for the loading of the optional telescope data.
public class OpticalTelescopeDataLoad {
// the proposal id.
public String proposalID;
public class OpticalTelescopeDataLoad extends OpticalTelescopeDataProposal {

// the observation id for the telescope data.
public String observationID;
private String observationID;

/**
* the constructor for the data saved within the database for a given
Expand All @@ -15,7 +13,24 @@ public class OpticalTelescopeDataLoad {
* @param observationID: the observation id.
*/
public OpticalTelescopeDataLoad(String proposalID, String observationID) {
this.proposalID = proposalID;
super(proposalID);
this.observationID = observationID;
}

/**
* the default constructor for the data saved within the database for a given
* observation.
*/
public OpticalTelescopeDataLoad() {
super(null);
this.observationID = null;
}

public String getObservationID() {
return observationID;
}

public void setObservationID(String observationID) {
this.observationID = observationID;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.orph2020.pst.common.json;

public class OpticalTelescopeDataOverviewTableReturn extends
OpticalTelescopeDataTableReturn{
// the time selection.
private String telescopeTimeValue;

// the time selection unit.
private String telescopeTimeUnit;

// the condition.
private String condition;

/**
* constructor for the telescope data for saving.
*
* @param telescopeName: the telescope name.
* @param instrumentName: the instrument name chosen for the choices.
* @param telescopeTimeValue: the value of time.
* @param telescopeTimeUnit: the unit of time.
* @param condition: the condition.
*/
public OpticalTelescopeDataOverviewTableReturn (
String telescopeName, String instrumentName,
String telescopeTimeValue, String telescopeTimeUnit,
String condition) {
super(telescopeName, instrumentName);
this.telescopeTimeUnit = telescopeTimeUnit;
this.telescopeTimeValue = telescopeTimeValue;
this.condition = condition;
}

public OpticalTelescopeDataOverviewTableReturn() {
// No-argument constructor for Hibernate ORM
}

public String getTelescopeTimeValue() {
return telescopeTimeValue;
}

public void setTelescopeTimeValue(String telescopeTimeValue) {
this.telescopeTimeValue = telescopeTimeValue;
}

public String getTelescopeTimeUnit() {
return telescopeTimeUnit;
}

public void setTelescopeTimeUnit(String telescopeTimeUnit) {
this.telescopeTimeUnit = telescopeTimeUnit;
}

public String getCondition() {
return condition;
}

public void setCondition(String condition) {
this.condition = condition;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.orph2020.pst.common.json;

/**
* creates a holder for the proposal id only.
*/
public class OpticalTelescopeDataProposal {
// the proposal id
private String proposalID;

// default constructor.
public OpticalTelescopeDataProposal() {
}

/**
* constructor.
*
* @param proposalID the proposal id.
*/
public OpticalTelescopeDataProposal(String proposalID) {
this.proposalID = proposalID;
}

public String getProposalID() {
return proposalID;
}

public void setProposalID(String proposalID) {
this.proposalID = proposalID;
}
}
Loading