|
1 | | -/* |
2 | | - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
3 | | - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template |
4 | | - */ |
5 | 1 | package io.gdcc.spi.export; |
6 | 2 |
|
7 | 3 | /** |
8 | 4 | * |
9 | 5 | * @author landreev |
| 6 | + * Provides an optional mechanism for defining various data retrieval options |
| 7 | + * for the export subsystem in a way that should allow us adding support for |
| 8 | + * more options going forward with minimal or no changes to the already |
| 9 | + * implemented export plugins. |
10 | 10 | */ |
11 | 11 | public class ExportDataContext { |
| 12 | + private boolean datasetMetadataOnly = false; |
| 13 | + private boolean publicFilesOnly = false; |
| 14 | + private Integer offset = null; |
| 15 | + private Integer length = null; |
| 16 | + |
| 17 | + private ExportDataContext() { |
| 18 | + |
| 19 | + } |
| 20 | + |
| 21 | + public static ExportDataContext context() { |
| 22 | + ExportDataContext context = new ExportDataContext(); |
| 23 | + return context; |
| 24 | + } |
| 25 | + |
| 26 | + public ExportDataContext withDatasetMetadataOnly() { |
| 27 | + this.datasetMetadataOnly = true; |
| 28 | + return this; |
| 29 | + } |
| 30 | + |
| 31 | + public ExportDataContext withPublicFilesOnly() { |
| 32 | + this.publicFilesOnly = true; |
| 33 | + return this; |
| 34 | + } |
| 35 | + |
| 36 | + public ExportDataContext withOffset(Integer offset) { |
| 37 | + this.offset = offset; |
| 38 | + return this; |
| 39 | + } |
| 40 | + |
| 41 | + public ExportDataContext withLength(Integer length) { |
| 42 | + this.length = length; |
| 43 | + return this; |
| 44 | + } |
| 45 | + |
| 46 | + public boolean isDatasetMetadataOnly() { |
| 47 | + return datasetMetadataOnly; |
| 48 | + } |
| 49 | + |
| 50 | + public boolean isPublicFilesOnly() { |
| 51 | + return publicFilesOnly; |
| 52 | + } |
| 53 | + |
| 54 | + public Integer getOffset() { |
| 55 | + return offset; |
| 56 | + } |
12 | 57 |
|
| 58 | + public Integer getLength() { |
| 59 | + return length; |
| 60 | + } |
13 | 61 | } |
0 commit comments