Skip to content

Commit cb06d89

Browse files
committed
the new context object (was missing from the previous commit in error) #11766
1 parent 75d99d0 commit cb06d89

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed
Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,61 @@
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-
*/
51
package io.gdcc.spi.export;
62

73
/**
84
*
95
* @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.
1010
*/
1111
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+
}
1257

58+
public Integer getLength() {
59+
return length;
60+
}
1361
}

0 commit comments

Comments
 (0)