Class RepositorySearchRequest

java.lang.Object
com.atlassian.bitbucket.repository.RepositorySearchRequest

public class RepositorySearchRequest extends Object
Request for searching repositories. The purpose and behaviour of each field is described on its accessor.

The term "prefix-match", when used in this documentation, describes a string matching process that satisfies the following criteria:

  • the matched value starts with the provided filter value
  • the matching is performed in a case-insensitive manner
  • the filter string's leading and trailing whitespace characters are ignored
  • a blank filter (null, or whitespace characters only) is treated as 'empty' and results in all repositories being returned for the purpose of that particular filter (note that other filters specified in conjunction with that filter may still limit the final result)
  • Method Details

    • getArchived

      @Nullable public RepositoryArchiveFilter getArchived()
      When set, limits returned repositories to only those, whose boolean archive state match the provided value.

      The provided value may be null, in which case no additional restriction is applied to the search.

      Returns:
      the required boolean archive state, or null
      Since:
      8.0
    • getName

      @Nullable public String getName()
      When set, limits returned repositories to only those that prefix-match the provided value according to the rules described in the class header.

      If this field is not set, it is assumed that all repositories shall be returned, regardless of the repository name. Applying the projectName filter would still limit the results to matching project names in such case.

      Returns:
      filter text to match against repository names (and possibly project names), or null to return repositories regardless of name.
      See Also:
    • getProjectName

      @Nullable public String getProjectName()
      When set, limits returned repositories to only those, whose project's name prefix-match the provided value.

      If this field is not set, it is assumed that all repositories shall be returned, regardless of the project name. Applying other filters would still limit the final results in such case.

      Returns:
      filter text to match against project names, or null to return repositories regardless of the project name
      See Also:
    • getProjectKey

      @Nullable public String getProjectKey()
      When set, limits returned repositories to only those, whose project's key exact-match (case-insensitive) the provided value.

      If this field is not set, it is assumed that all repositories shall be returned, regardless of the project key. Applying other filters would still limit the final results in such case.

      Returns:
      the required repository project key, or null
      Since:
      8.0
    • getState

      @Nullable public Repository.State getState()
      When set, limits returned repositories to only those that are in the specified state. The provided value may be null, in which case no additional restriction is applied to the search.
      Returns:
      the required repository state, or null
      Since:
      5.13
    • getPermission

      @Nullable public Permission getPermission()
      When set, limits returned repositories to only those for which the current user has the required Permission. The provided value may be null, in which case a default permission Permission.REPO_READ will be used.
      Returns:
      the required repository permission, or null to default to Permission.REPO_READ
    • getVisibility

      @Nullable public RepositoryVisibility getVisibility()
      When set, limits returned repositories to only those which match the specified visibility. The provided value may be null, in which case no additional restriction is applied to the search.
      Returns:
      the required repository visibility, or null to return repositories regardless of visibility.
      See Also:
    • hasArchived

      public boolean hasArchived()
      Retrieves a flag indicating whether archived text has been set.
      Returns:
      true if getArchived() is not null, false otherwise
      Since:
      8.0
    • hasName

      public boolean hasName()
      Retrieves a flag indicating whether name text has been set.
      Returns:
      true if getName() is not null or whitespace, false otherwise
      See Also:
    • hasProjectName

      public boolean hasProjectName()
      Retrieves a flag indicating whether getProjectName() projectName} text has been set.
      Returns:
      true if getName() is not null or whitespace, false otherwise
    • hasProjectKey

      public boolean hasProjectKey()
      Retrieves a flag indicating whether getProjectKey() projectKey} text has been set.
      Returns:
      true if getProjectKey() is not null or whitespace, false otherwise
      Since:
      8.0
    • hasPermission

      public boolean hasPermission()
      Retrieves a flag indicating whether a specific permission has been set. If no explicit permission has been set, the search will default to Permission.REPO_READ.
      Returns:
      true if getPermission() is not null, false otherwise
      See Also:
    • hasState

      public boolean hasState()
      Retrieves a flag indicating whether getState() state} has been set.
      Returns:
      true if getState() is not null, false otherwise
      Since:
      5.13
    • hasVisibility

      public boolean hasVisibility()
      Retrieves a flag indicating whether a specific visibility has been set.
      Returns:
      true if getVisibility() is not null, false otherwise
      See Also:
    • isEmpty

      public boolean isEmpty()
      Checks whether this request is considered empty, that is, none of the filters have been set.
      Returns:
      true, if none of the filter fields on this request have been set, false otherwise
      See Also: