Package com.dropbox.core.v2.files
Class SearchOptions.Builder
java.lang.Object
com.dropbox.core.v2.files.SearchOptions.Builder
- Enclosing class:
SearchOptions
Builder for
SearchOptions.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<FileCategory> protected booleanprotected FileStatusprotected longprotected SearchOrderByprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance ofSearchOptionsconfigured with this builder's valueswithAccountId(String accountId) Set value for optional field.withFileCategories(List<FileCategory> fileCategories) Set value for optional field.withFileExtensions(List<String> fileExtensions) Set value for optional field.withFilenameOnly(Boolean filenameOnly) Set value for optional field.withFileStatus(FileStatus fileStatus) Set value for optional field.withMaxResults(Long maxResults) Set value for optional field.withOrderBy(SearchOrderBy orderBy) Set value for optional field.Set value for optional field.
-
Field Details
-
path
-
maxResults
protected long maxResults -
orderBy
-
fileStatus
-
filenameOnly
protected boolean filenameOnly -
fileExtensions
-
fileCategories
-
accountId
-
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
withPath
Set value for optional field.- Parameters:
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]+(/(.|[\\r\\n])*)?)".- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withMaxResults
Set value for optional field.If left unset or set to
null, defaults to100L.- Parameters:
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 to100Lwhen set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withOrderBy
Set value for optional field.- Parameters:
orderBy- Specified property of the order of search results. By default, results are sorted by relevance.- Returns:
- this builder
-
withFileStatus
Set value for optional field.If left unset or set to
null, defaults toFileStatus.ACTIVE.- Parameters:
fileStatus- Restricts search to the given file status. Must not benull. Defaults toFileStatus.ACTIVEwhen set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withFilenameOnly
Set value for optional field.If left unset or set to
null, defaults tofalse.- Parameters:
filenameOnly- Restricts search to only match on filenames. Defaults tofalsewhen set tonull.- Returns:
- this builder
-
withFileExtensions
Set value for optional field.- Parameters:
fileExtensions- Restricts search to only the extensions specified. Only supported for active file search. Must not contain anullitem.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withFileCategories
Set value for optional field.- Parameters:
fileCategories- Restricts search to only the file categories specified. Only supported for active file search. Must not contain anullitem.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withAccountId
Set value for optional field.- Parameters:
accountId- Restricts results to the given account id. Must have length of at least 40 and have length of at most 40.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
build
Builds an instance ofSearchOptionsconfigured with this builder's values- Returns:
- new instance of
SearchOptions
-