Skip to content

Commit

Permalink
add missing class
Browse files Browse the repository at this point in the history
  • Loading branch information
wow-such-code committed Jul 16, 2024
1 parent a9f9e53 commit 5f773a1
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/main/java/life/qbic/model/DatasetWithProperties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package life.qbic.model;

import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.DataSet;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.DataSetType;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.Experiment;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.person.Person;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
* Wrapper class for openBIS DataSets that collects additional information, e.g. from samples,
* experiments etc. further up in the hierarchy.
*/
public class DatasetWithProperties {

private final DataSet dataset;
private final Map<String, String> properties;

public DatasetWithProperties(DataSet dataset) {
this.dataset = dataset;
this.properties = new HashMap<>();
}

public void addProperty(String key, String value) {
this.properties.put(key, value);
}

public String getProperty(String key) {
return properties.get(key);
}

public Map<String, String> getProperties() {
return properties;
}

public DataSet getDataset() {
return dataset;
}

public String getCode() {
return dataset.getCode();
}

public Experiment getExperiment() {
return dataset.getExperiment();
}

public DataSetType getType() {
return dataset.getType();
}

public Person getRegistrator() {
return dataset.getRegistrator();
}

public Date getRegistrationDate() {
return dataset.getRegistrationDate();
}
}

0 comments on commit 5f773a1

Please sign in to comment.