Package com.atlassian.bitbucket.project
Interface Project
- All Known Subinterfaces:
PersonalProject
public interface Project
Describes a project in the system.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The regexp to validate the project key when creating or updating from an untrusted source.static final String
The regexp to validate the project key when creating or updating from a trusted source, which is slightly more relaxed thanKEY_REGEXP
.static final int
The maximum length of a project key.static final int
The maximum length of a project name.static final String
The regexp to validate the project name. -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(ProjectVisitor<T> visitor) int
getId()
@Pattern(regexp="[a-zA-Z][a-zA-Z0-9_\\-]*",groups={Create.class,Update.class},message="{com.atlassian.bitbucket.validation.project.key.pattern.message}") @Pattern(regexp="~[a-zA-Z0-9\\-_.]+|[a-zA-Z][a-zA-Z0-9_\\-]*",groups={TrustedCreate.class,TrustedUpdate.class},message="{com.atlassian.bitbucket.validation.project.key.trusted.pattern.message}") String
getKey()
@Pattern(regexp="^[^~].*",groups={Create.class,Update.class},message="{com.atlassian.bitbucket.validation.project.name.pattern.message}") String
getName()
getType()
Retrieves the project'stype
.boolean
isPublic()
Retrieves a flag indicating whether this project is public.
-
Field Details
-
KEY_REGEXP
The regexp to validate the project key when creating or updating from an untrusted source.- See Also:
-
KEY_TRUSTED_REGEXP
The regexp to validate the project key when creating or updating from a trusted source, which is slightly more relaxed thanKEY_REGEXP
. This regexp allowsPersonalProject
keys (which must begin with tilda, and have less restrictions on which characters can be included) and normal project keys (represented byKEY_REGEXP
, which must not begin with tilda).- See Also:
-
MAX_KEY_LENGTH
static final int MAX_KEY_LENGTHThe maximum length of a project key.- See Also:
-
MAX_NAME_LENGTH
static final int MAX_NAME_LENGTHThe maximum length of a project name.- Since:
- 4.10
- See Also:
-
NAME_REGEXP
The regexp to validate the project name.- Since:
- 4.4
- See Also:
-
-
Method Details
-
accept
- Type Parameters:
T
- type of visitor- Parameters:
visitor
- the visitor to process the project instance- Returns:
- a visitor of the supplied type
-
getDescription
-
getId
int getId() -
isPublic
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
-
getKey
@Pattern(regexp="[a-zA-Z][a-zA-Z0-9_\\-]*",groups={Create.class,Update.class},message="{com.atlassian.bitbucket.validation.project.key.pattern.message}") @Pattern(regexp="~[a-zA-Z0-9\\-_.]+|[a-zA-Z][a-zA-Z0-9_\\-]*",groups={TrustedCreate.class,TrustedUpdate.class},message="{com.atlassian.bitbucket.validation.project.key.trusted.pattern.message}") @RequiredString(size=128) @Pattern(regexp="[a-zA-Z][a-zA-Z0-9_\\-]*",groups={Create.class,Update.class},message="{com.atlassian.bitbucket.validation.project.key.pattern.message}") @Pattern(regexp="~[a-zA-Z0-9\\-_.]+|[a-zA-Z][a-zA-Z0-9_\\-]*",groups={TrustedCreate.class,TrustedUpdate.class},message="{com.atlassian.bitbucket.validation.project.key.trusted.pattern.message}") String getKey() -
getName
@Pattern(regexp="^[^~].*", groups={Create.class,Update.class}, message="{com.atlassian.bitbucket.validation.project.name.pattern.message}") @RequiredString(size=128) @Pattern(regexp="^[^~].*",groups={Create.class,Update.class},message="{com.atlassian.bitbucket.validation.project.name.pattern.message}") String getName() -
getType
Retrieves the project'stype
. See the documentation for the various types to determine what interfaces each implements.- Returns:
- the
type
for this project
-