Class SearchOptions

java.lang.Object
com.dropbox.core.v2.files.SearchOptions

public class SearchOptions extends Object
  • Field Details

    • path

      @Nullable protected final String path
    • maxResults

      protected final long maxResults
    • orderBy

      @Nullable protected final SearchOrderBy orderBy
    • fileStatus

      @Nonnull protected final FileStatus fileStatus
    • filenameOnly

      protected final boolean filenameOnly
    • fileExtensions

      @Nullable protected final List<String> fileExtensions
    • fileCategories

      @Nullable protected final List<FileCategory> fileCategories
    • accountId

      @Nullable protected final String accountId
  • Constructor Details

    • SearchOptions

      public SearchOptions(@Nullable String path, long maxResults, @Nullable SearchOrderBy orderBy, @Nonnull FileStatus fileStatus, boolean filenameOnly, @Nullable List<String> fileExtensions, @Nullable List<FileCategory> fileCategories, @Nullable String accountId)
      Use newBuilder() to create instances of this class without specifying values for all optional fields.
      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])*)?)".
      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.
      orderBy - Specified property of the order of search results. By default, results are sorted by relevance.
      fileStatus - Restricts search to the given file status. Must not be null.
      filenameOnly - Restricts search to only match on filenames.
      fileExtensions - Restricts search to only the extensions specified. Only supported for active file search. Must not contain a null item.
      fileCategories - Restricts search to only the file categories specified. Only supported for active file search. Must not contain a null item.
      accountId - Restricts results to the given account id. Must have length of at least 40 and have length of at most 40.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • SearchOptions

      public SearchOptions()
      None

      The default values for unset fields will be used.

  • Method Details

    • getPath

      @Nullable public String getPath()
      Scopes the search to a path in the user's Dropbox. Searches the entire Dropbox if not specified.
      Returns:
      value for this field, or null if not present.
    • getMaxResults

      public long getMaxResults()
      The maximum number of search results to return.
      Returns:
      value for this field, or null if not present. Defaults to 100L.
    • getOrderBy

      @Nullable public SearchOrderBy getOrderBy()
      Specified property of the order of search results. By default, results are sorted by relevance.
      Returns:
      value for this field, or null if not present.
    • getFileStatus

      @Nonnull public FileStatus getFileStatus()
      Restricts search to the given file status.
      Returns:
      value for this field, or null if not present. Defaults to FileStatus.ACTIVE.
    • getFilenameOnly

      public boolean getFilenameOnly()
      Restricts search to only match on filenames.
      Returns:
      value for this field, or null if not present. Defaults to false.
    • getFileExtensions

      @Nullable public List<String> getFileExtensions()
      Restricts search to only the extensions specified. Only supported for active file search.
      Returns:
      value for this field, or null if not present.
    • getFileCategories

      @Nullable public List<FileCategory> getFileCategories()
      Restricts search to only the file categories specified. Only supported for active file search.
      Returns:
      value for this field, or null if not present.
    • getAccountId

      @Nullable public String getAccountId()
      Restricts results to the given account id.
      Returns:
      value for this field, or null if not present.
    • newBuilder

      public static SearchOptions.Builder newBuilder()
      Returns a new builder for creating an instance of this class.
      Returns:
      builder for this class.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public String toStringMultiline()
      Returns a String representation of this object formatted for easier readability.

      The returned String may contain newlines.

      Returns:
      Formatted, multiline String representation of this object