diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataSetBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataSetBuilder.java index ac6d7e320684c8fe9580b3ad1c966dc489ddf82a..186d8f4a39207b0c292804c86210324dd57947d8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataSetBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataSetBuilder.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto.builders; import java.util.ArrayList; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; @@ -75,6 +76,12 @@ public class DataSetBuilder return this; } + public DataSetBuilder store(DataStore dataStore) + { + dataSet.setDataStore(dataStore); + return this; + } + public final ExternalData getDataSet() { return dataSet; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..4c0c9eb24a20dacbef24775a1e4954041ba216a3 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2011 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.shared.basic.dto.builders; + +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; + +/** + * Builder class for creating an instance of {@link DataStore}. + * + * @author Franz-Josef Elmer + */ +public class DataStoreBuilder +{ + private DataStore store = new DataStore(); + + public DataStoreBuilder(String dataStoreCode) + { + store.setCode(dataStoreCode); + } + + public DataStoreBuilder hostUrl(String hostUrl) + { + store.setHostUrl(hostUrl); + return this; + } + + public DataStoreBuilder downloadUrl(String downloadUrl) + { + store.setDownloadUrl(downloadUrl); + return this; + } + + public DataStore getStore() + { + return store; + } + +}