public static class SearchOptions.Builder
extends java.lang.Object
SearchOptions
.Modifier and Type | Field and Description |
---|---|
protected java.util.List<FileCategory> |
fileCategories |
protected java.util.List<java.lang.String> |
fileExtensions |
protected boolean |
filenameOnly |
protected FileStatus |
fileStatus |
protected long |
maxResults |
protected java.lang.String |
path |
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
SearchOptions |
build()
Builds an instance of
SearchOptions configured with this
builder's values |
SearchOptions.Builder |
withFileCategories(java.util.List<FileCategory> fileCategories)
Set value for optional field.
|
SearchOptions.Builder |
withFileExtensions(java.util.List<java.lang.String> fileExtensions)
Set value for optional field.
|
SearchOptions.Builder |
withFilenameOnly(java.lang.Boolean filenameOnly)
Set value for optional field.
|
SearchOptions.Builder |
withFileStatus(FileStatus fileStatus)
Set value for optional field.
|
SearchOptions.Builder |
withMaxResults(java.lang.Long maxResults)
Set value for optional field.
|
SearchOptions.Builder |
withPath(java.lang.String path)
Set value for optional field.
|
protected java.lang.String path
protected long maxResults
protected FileStatus fileStatus
protected boolean filenameOnly
protected java.util.List<java.lang.String> fileExtensions
protected java.util.List<FileCategory> fileCategories
public SearchOptions.Builder withPath(java.lang.String path)
path
- Scopes the search to a path in the user's Dropbox.
Searches the entire Dropbox if not specified. Must match pattern
"(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)
".java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public SearchOptions.Builder withMaxResults(java.lang.Long maxResults)
If left unset or set to null
, defaults to 100L
.
maxResults
- The maximum number of search results to return.
Must be greater than or equal to 1 and be less than or equal to
1000. Defaults to 100L
when set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public SearchOptions.Builder withFileStatus(FileStatus fileStatus)
If left unset or set to null
, defaults to FileStatus.ACTIVE
.
fileStatus
- Restricts search to the given file status. Must
not be null
. Defaults to FileStatus.ACTIVE
when
set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public SearchOptions.Builder withFilenameOnly(java.lang.Boolean filenameOnly)
If left unset or set to null
, defaults to false
.
filenameOnly
- Restricts search to only match on filenames.
Defaults to false
when set to null
.public SearchOptions.Builder withFileExtensions(java.util.List<java.lang.String> fileExtensions)
fileExtensions
- Restricts search to only the extensions
specified. Only supported for active file search. Must not
contain a null
item.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public SearchOptions.Builder withFileCategories(java.util.List<FileCategory> fileCategories)
fileCategories
- Restricts search to only the file categories
specified. Only supported for active file search. Must not
contain a null
item.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public SearchOptions build()
SearchOptions
configured with this
builder's valuesSearchOptions