Interface Project

All Known Subinterfaces:
PersonalProject

public interface Project
Describes a project in the system.
  • Field Details

    • KEY_REGEXP

      static final String KEY_REGEXP
      The regexp to validate the project key when creating or updating from an untrusted source.
      See Also:
    • KEY_TRUSTED_REGEXP

      static final String KEY_TRUSTED_REGEXP
      The regexp to validate the project key when creating or updating from a trusted source, which is slightly more relaxed than KEY_REGEXP. This regexp allows PersonalProject keys (which must begin with tilda, and have less restrictions on which characters can be included) and normal project keys (represented by KEY_REGEXP, which must not begin with tilda).
      See Also:
    • MAX_KEY_LENGTH

      static final int MAX_KEY_LENGTH
      The maximum length of a project key.
      See Also:
    • MAX_NAME_LENGTH

      static final int MAX_NAME_LENGTH
      The maximum length of a project name.
      Since:
      4.10
      See Also:
    • NAME_REGEXP

      static final String NAME_REGEXP
      The regexp to validate the project name.
      Since:
      4.4
      See Also:
  • Method Details

    • accept

      <T> T accept(@Nonnull ProjectVisitor<T> visitor)
      Type Parameters:
      T - type of visitor
      Parameters:
      visitor - the visitor to process the project instance
      Returns:
      a visitor of the supplied type
    • getDescription

      @OptionalString(size=255) String 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

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