Package io.gdcc.spi.export
Class DatasetExportQuery.Builder
java.lang.Object
io.gdcc.spi.export.DatasetExportQuery.Builder
- Enclosing class:
- DatasetExportQuery
Builder for
DatasetExportQuery.
Obtain an instance via DatasetExportQuery.builder() or
from(DatasetExportQuery) to derive a new query from an existing one.
-
Method Summary
Modifier and TypeMethodDescriptionaddDatasetPredicate(DatasetMetadataPredicates predicate) Adds a dataset metadata predicate to the builder's collection of predicates.build()Builds an immutableDatasetExportQuery.datasetPredicates(DatasetMetadataPredicates... predicates) Sets the dataset metadata predicates, replacing any previously set predicates.datasetPredicates(Collection<DatasetMetadataPredicates> predicates) Sets the dataset metadata predicates, replacing any previously set predicates.fileQuery(FileExportQuery fileQuery) Sets theFileExportQueryto use for shaping file metadata nested within this dataset query.from(DatasetExportQuery source) Creates a newDatasetExportQuery.Builderpre-populated with the state of the given query, useful for deriving a modified copy without altering the original.
-
Method Details
-
datasetPredicates
Sets the dataset metadata predicates, replacing any previously set predicates.- Parameters:
predicates- the dataset metadata predicates to set- Returns:
- this builder instance
-
datasetPredicates
public DatasetExportQuery.Builder datasetPredicates(Collection<DatasetMetadataPredicates> predicates) Sets the dataset metadata predicates, replacing any previously set predicates.- Parameters:
predicates- the dataset metadata predicates to set- Returns:
- this builder instance
-
addDatasetPredicate
Adds a dataset metadata predicate to the builder's collection of predicates.- Parameters:
predicate- the dataset metadata predicate to add- Returns:
- this builder instance
-
fileQuery
Sets theFileExportQueryto use for shaping file metadata nested within this dataset query. Replaces any previously set file query.If not set, methods that include file metadata will apply their own defaults.
- Parameters:
fileQuery- the file export query to compose into this dataset query- Returns:
- this builder instance
-
build
Builds an immutableDatasetExportQuery.- Returns:
- a new, validated
DatasetExportQuery - Throws:
IllegalArgumentException- if the predicate combination is invalid, e.g. due to conflicting predicates
-
from
Creates a newDatasetExportQuery.Builderpre-populated with the state of the given query, useful for deriving a modified copy without altering the original.- Parameters:
source- theDatasetExportQueryinstance to copy from- Returns:
- a new
Builderwith the same predicates and file query assource
-