public interface

Project

com.atlassian.bitbucket.project.Project
Known Indirect Subclasses

Class Overview

Describes a project in the system.

Summary

Constants
String KEY_REGEXP The regexp to validate the project key when creating or updating from an untrusted source.
String KEY_TRUSTED_REGEXP The regexp to validate the project key when creating or updating from a trusted source - slightly more relaxed than KEY_REGEXP by allowing project keys that start with a tilda as do personal projects.
int MAX_KEY_LENGTH The maximum length of a project key.
int MAX_NAMESPACE_LENGTH The maximum length of a project namespace.
int MAX_NAME_LENGTH The maximum length of a project name.
String NAMESPACE_REGEXP The regexp to validate the project namespace.
String NAME_REGEXP The regexp to validate the project name.
Public Methods
<T> T accept(ProjectVisitor<T> visitor)
@OptionalString String getDescription()
int getId()
@Pattern.List @RequiredString String getKey()
@Pattern @RequiredString String getName()
@Pattern @OptionalString String getNamespace()
@Nonnull ProjectType getType()
Retrieves the project's type.
boolean isPublic()
Retrieves a flag indicating whether this project is public.

Constants

public static final String KEY_REGEXP

The regexp to validate the project key when creating or updating from an untrusted source.

Constant Value: "[a-zA-Z][a-zA-Z0-9_\-]*"

public static final String KEY_TRUSTED_REGEXP

The regexp to validate the project key when creating or updating from a trusted source - slightly more relaxed than KEY_REGEXP by allowing project keys that start with a tilda as do personal projects.

Constant Value: "~?[a-zA-Z][a-zA-Z0-9_\-]*"

public static final int MAX_KEY_LENGTH

The maximum length of a project key.

Constant Value: 128 (0x00000080)

public static final int MAX_NAMESPACE_LENGTH

The maximum length of a project namespace.

Constant Value: 128 (0x00000080)

public static final int MAX_NAME_LENGTH

The maximum length of a project name.

Constant Value: 128 (0x00000080)

public static final String NAMESPACE_REGEXP

The regexp to validate the project namespace.

Constant Value: "[a-zA-Z0-9_\-]*"

public static final String NAME_REGEXP

The regexp to validate the project name.

Constant Value: "^[^~].*"

Public Methods

public T accept (ProjectVisitor<T> visitor)

Parameters
visitor the visitor to process the project instance

@OptionalString public String getDescription ()

public int getId ()

@Pattern.List @RequiredString public String getKey ()

@Pattern @RequiredString public String getName ()

@Pattern @OptionalString public String getNamespace ()

Returns
  • the project's namespace. Namespaces are only supported in mirror mode and will be null in standard installations.

@Nonnull public ProjectType getType ()

Retrieves the project's type. See the documentation for the various types to determine what interfaces each implements.

Returns
  • the type for this project

public boolean isPublic ()

Retrieves a flag indicating whether this project is public.

Note, this flag is taken into account when calculating whether this project is accessible to unauthenticated users but is not the definitive answer. For a definitive answer, use isPubliclyAccessible.

Returns
  • true if the project has been marked as public, false otherwise