-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9f9e53
commit 5f773a1
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |