public class

RepositorySearchRequest

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

Class Overview

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)

Summary

Nested Classes
class RepositorySearchRequest.Builder  
Public Methods
@Nullable 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.
@Nullable Permission getPermission()
When set, limits returned repositories to only those for which the current user has the required Permission.
@Nullable String getProjectName()
When set, limits returned repositories to only those, whose project's name prefix-match the provided value.
@Nullable Repository.State getState()
When set, limits returned repositories to only those that are in the specified state.
@Nullable RepositoryVisibility getVisibility()
When set, limits returned repositories to only those which match the specified visibility.
boolean hasName()
Retrieves a flag indicating whether name text has been set.
boolean hasPermission()
Retrieves a flag indicating whether a specific permission has been set.
boolean hasProjectName()
Retrieves a flag indicating whether getProjectName() projectName} text has been set.
boolean hasState()
Retrieves a flag indicating whether getState() state} has been set.
boolean hasVisibility()
Retrieves a flag indicating whether a specific visibility has been set.
boolean isEmpty()
Checks whether this request is considered empty, that is, none of the filters have been set.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

@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

@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 REPO_READ will be used.

Returns
  • the required repository permission, or null to default to REPO_READ

@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

@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

@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.

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

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 REPO_READ.

Returns
See Also

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

public boolean hasState ()

Retrieves a flag indicating whether getState() state} has been set.

Returns
  • true if getState() ()} is not null, false otherwise

public boolean hasVisibility ()

Retrieves a flag indicating whether a specific visibility has been set.

Returns
See Also

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