Package org.rcsb.cif
Class CifOptions.CifOptionsBuilder
java.lang.Object
org.rcsb.cif.CifOptions.CifOptionsBuilder
- Enclosing class:
- CifOptions
public static class CifOptions.CifOptionsBuilder extends Object
Internal class to handle the option building process.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCifOptions.CifOptionsBuilder.FileFormatSupported file formats. -
Constructor Summary
Constructors Constructor Description CifOptionsBuilder() -
Method Summary
Modifier and Type Method Description CifOptionsbuild()Exit this builder and retrieve the actual, immutableCifOptionsinstance.CifOptions.CifOptionsBuildercategoryBlacklist(String... categoryBlacklist)Add entries to the category blacklist.CifOptions.CifOptionsBuildercategoryBlacklist(List<String> categoryBlacklist)Add entries to the category blacklist.CifOptions.CifOptionsBuildercategoryWhitelist(String... categoryWhitelist)Add entries to the category whitelist.CifOptions.CifOptionsBuildercategoryWhitelist(List<String> categoryWhitelist)Add entries to the category whitelist.CifOptions.CifOptionsBuildercolumnBlacklist(String... columnBlacklist)Add entries to the column blacklist.CifOptions.CifOptionsBuildercolumnBlacklist(List<String> columnBlacklist)Add entries to the column blacklist.CifOptions.CifOptionsBuildercolumnWhitelist(String... columnWhitelist)Add entries to the column whitelist.CifOptions.CifOptionsBuildercolumnWhitelist(List<String> columnWhitelist)Add entries to the column whitelist.CifOptions.CifOptionsBuilderencoder(String encoder)The name of the encoder which should be written to files.CifOptions.CifOptionsBuilderencodingStrategyHint(String json)ReadEncodingStrategyHintdata from a JSON string.CifOptions.CifOptionsBuilderencodingStrategyHint(String categoryName, String columnName, String encoding, int precision)Manually specify encoding strategy and precision for a column.CifOptions.CifOptionsBuilderencodingStrategyHint(Path path)ReadEncodingStrategyHintdata from a JSON file.CifOptions.CifOptionsBuilderencodingStrategyHint(List<EncodingStrategyHint> encodingStrategyHints)Manually specify encoding strategy and precision for a column.CifOptions.CifOptionsBuilderencodingStrategyHint(EncodingStrategyHint... encodingStrategyHints)Manually specify encoding strategy and precision for a column.CifOptions.CifOptionsBuilderfetchUrl(String fetchUrl)The URL from which files should be fetched - must follow the pattern:www.source.com/%s.cif, where%srepresents the pdbId to be inserted into the URL to fetch the correct file.CifOptions.CifOptionsBuilderfileFormatHint(CifOptions.CifOptionsBuilder.FileFormat fileFormat)The library can automatically detect compression and file format.CifOptions.CifOptionsBuildergzip(boolean gzip)Allows for downstream GZIP operations.
-
Constructor Details
-
CifOptionsBuilder
public CifOptionsBuilder()
-
-
Method Details
-
gzip
Allows for downstream GZIP operations.- Parameters:
gzip-trueif the output should be gzipped- Returns:
- this builder instance
-
encoder
The name of the encoder which should be written to files.- Parameters:
encoder- String representing the encoder name- Returns:
- this builder instance
-
fetchUrl
The URL from which files should be fetched - must follow the pattern:www.source.com/%s.cif, where%srepresents the pdbId to be inserted into the URL to fetch the correct file.- Parameters:
fetchUrl- the specified fetch URL- Returns:
- this builder instance
-
categoryWhitelist
Add entries to the category whitelist. If the whitelist has any entries, the category must be explicitly contained for the category to appear in the output.- Parameters:
categoryWhitelist- a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded- Returns:
- this builder instance
-
categoryWhitelist
Add entries to the category whitelist. If the whitelist has any entries, the category must be explicitly contained for the category to appear in the output.- Parameters:
categoryWhitelist- a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded- Returns:
- this builder instance
-
categoryBlacklist
Add entries to the category blacklist. Any entries will be ignored when composing the output.- Parameters:
categoryBlacklist- a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included- Returns:
- this builder instance
-
categoryBlacklist
Add entries to the category blacklist. Any entries will be ignored when composing the output.- Parameters:
categoryBlacklist- a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included- Returns:
- this builder instance
-
columnWhitelist
Add entries to the column whitelist. If the whitelist has any entries, the column must be explicitly contained for the column to appear in the output. Names follow the patterncategory_name.column_name.- Parameters:
columnWhitelist- a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded- Returns:
- this builder instance
-
columnWhitelist
Add entries to the column whitelist. If the whitelist has any entries, the column must be explicitly contained for the column to appear in the output. Names follow the patterncategory_name.column_name.- Parameters:
columnWhitelist- a collection of String values to explicitly include in the output, all other possible entries will be implicitly excluded- Returns:
- this builder instance
-
columnBlacklist
Add entries to the column blacklist. Any entries will be ignored when composing the output. Names follow the patterncategory_name.column_name.- Parameters:
columnBlacklist- a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included- Returns:
- this builder instance
-
columnBlacklist
Add entries to the column blacklist. Any entries will be ignored when composing the output. Names follow the patterncategory_name.column_name.- Parameters:
columnBlacklist- a collection of String values to explicitly exclude from the output, all other possible entries will be implicitly included- Returns:
- this builder instance
-
encodingStrategyHint
ReadEncodingStrategyHintdata from a JSON file.- Parameters:
path- the file to read- Returns:
- this builder instance
-
encodingStrategyHint
ReadEncodingStrategyHintdata from a JSON string.- Parameters:
json- the string to read- Returns:
- this builder instance
-
encodingStrategyHint
public CifOptions.CifOptionsBuilder encodingStrategyHint(String categoryName, String columnName, String encoding, int precision)Manually specify encoding strategy and precision for a column.- Parameters:
categoryName- the category namecolumnName- the column nameencoding- the encoding to employ: "pack" | "rle" | "delta" | "delta-rle"precision- the number of decimal places to keep duringFixedPointEncoding- Returns:
- this builder instance
-
encodingStrategyHint
public CifOptions.CifOptionsBuilder encodingStrategyHint(EncodingStrategyHint... encodingStrategyHints)Manually specify encoding strategy and precision for a column.- Parameters:
encodingStrategyHints- the hints to process- Returns:
- this builder instance
-
encodingStrategyHint
public CifOptions.CifOptionsBuilder encodingStrategyHint(List<EncodingStrategyHint> encodingStrategyHints)Manually specify encoding strategy and precision for a column.- Parameters:
encodingStrategyHints- the hints to process- Returns:
- this builder instance
-
fileFormatHint
public CifOptions.CifOptionsBuilder fileFormatHint(CifOptions.CifOptionsBuilder.FileFormat fileFormat)The library can automatically detect compression and file format. This involves some guessing and can be omitted by specifying the format explicitly. This may increase performance and will improve safety when malformed or unexpected files are handled.- Parameters:
fileFormat- an instance of the supported file formats- Returns:
- this builder instance
-
build
Exit this builder and retrieve the actual, immutableCifOptionsinstance.- Returns:
- a
CifOptionsinstance
-