Class MockProject

java.lang.Object
com.atlassian.jira.project.MockProject
All Implemented Interfaces:
WithId, WithKey, Project, Named, NamedWithDescription

public class MockProject extends Object implements Project
Bean implementation of Project interface but doesn't believe in GenericValues. Equals and hashCode are based on id alone.
  • Constructor Details

    • MockProject

      public MockProject(org.ofbiz.core.entity.GenericValue gv)
    • MockProject

      public MockProject()
    • MockProject

      public MockProject(long id)
    • MockProject

      public MockProject(Long id)
    • MockProject

      public MockProject(long id, String key)
    • MockProject

      public MockProject(long id, String key, ProjectTypeKey projectTypeKey)
    • MockProject

      public MockProject(long id, String key, String name)
    • MockProject

      public MockProject(Long id, String key, String name)
    • MockProject

      public MockProject(long id, String key, String name, org.ofbiz.core.entity.GenericValue projectGV)
    • MockProject

      public MockProject(Long id, String key, String name, org.ofbiz.core.entity.GenericValue projectGV)
    • MockProject

      public MockProject(Long id, String key, String name, org.ofbiz.core.entity.GenericValue projectGV, ProjectTypeKey projectTypeKey)
  • Method Details

    • getAssigneeType

      public Long getAssigneeType()
      Description copied from interface: Project
      Returns the default assignee for issues that get created in this project. Returns AssigneeTypes.PROJECT_LEAD or AssigneeTypes.UNASSIGNED. Can return NULL if the default assignee has not been set for this project and this means the PROJECT LEAD is the default assignee.

      TODO: Write upgrade task to ensure default assignee is always set.

      Specified by:
      getAssigneeType in interface Project
      Returns:
      the default assignee. NB: Can return NULL
    • getProjectTypeKey

      public ProjectTypeKey getProjectTypeKey()
      Description copied from interface: Project
      Returns the key of the project type for this project.
      Specified by:
      getProjectTypeKey in interface Project
      Returns:
      The key of the project type for this project.
    • setAssigneeType

      public void setAssigneeType(Long assigneeType)
    • getProjectComponents

      public Collection<ProjectComponent> getProjectComponents()
      Description copied from interface: Project
      Returns the components for this Project.

      This is a synonym for Project.getComponents() that exists for legacy reasons.

      Specified by:
      getProjectComponents in interface Project
      Returns:
      the components for this Project.
      See Also:
    • setProjectComponents

      public void setProjectComponents(Collection<ProjectComponent> projectComponents)
    • getComponents

      public Collection<ProjectComponent> getComponents()
      Description copied from interface: Project
      Returns the components for this Project.
      Specified by:
      getComponents in interface Project
      Returns:
      the components for this Project.
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface NamedWithDescription
      Specified by:
      getDescription in interface Project
      Returns:
      the project description
    • setDescription

      public void setDescription(String description)
    • getId

      public Long getId()
      Specified by:
      getId in interface Project
      Specified by:
      getId in interface WithId
      Returns:
      the id of the project
    • setId

      public void setId(Long id)
    • getKey

      public String getKey()
      Specified by:
      getKey in interface Project
      Specified by:
      getKey in interface WithKey
      Returns:
      the project key.
    • setKey

      public void setKey(String key)
    • getName

      public String getName()
      Specified by:
      getName in interface Named
      Specified by:
      getName in interface Project
      Returns:
      the name of the project.
    • setName

      public void setName(String name)
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface Project
      Returns:
      the project URL
    • setUrl

      public void setUrl(String url)
    • setEmail

      public MockProject setEmail(String email)
    • getEmail

      public String getEmail()
      Specified by:
      getEmail in interface Project
      Returns:
      the project email address from which email notifications are sent.
    • getReplyToEmail

      public String getReplyToEmail()
      Description copied from interface: Project
      Returns the project's reply-to email address, where replies to messages will be received. The default return value is null for projects created before this field was added, or if the creator was removed after the project's creation.
      Specified by:
      getReplyToEmail in interface Project
      Returns:
      String the reply-to address of the project, or null by default.
    • setReplyToEmail

      public MockProject setReplyToEmail(String replyToEmail)
    • getVersions

      public Collection<Version> getVersions()
      Specified by:
      getVersions in interface Project
      Returns:
      a Collection of Version for this project
    • getIssueTypes

      public Collection<IssueType> getIssueTypes()
      Specified by:
      getIssueTypes in interface Project
      Returns:
      a Collection of IssueType for this project
    • setIssueTypes

      public MockProject setIssueTypes(IssueType... types)
    • setIssueTypes

      public MockProject setIssueTypes(Collection<IssueType> types)
    • setIssueTypes

      public MockProject setIssueTypes(String... types)
    • getProjectCategory

      public ProjectCategory getProjectCategory()
      Specified by:
      getProjectCategory in interface Project
      Returns:
      the project category information for this project.
    • getProjectCategoryObject

      public ProjectCategory getProjectCategoryObject()
      Description copied from interface: Project
      Returns the Project Category for this Project.

      This is a synonym for Project.getProjectCategory() that exists for legacy reasons.

      Specified by:
      getProjectCategoryObject in interface Project
      Returns:
      the project category information for this project.
      See Also:
    • setProjectCategory

      public void setProjectCategory(ProjectCategory projectCategory)
    • setVersions

      public void setVersions(Collection<Version> versions)
    • getGenericValue

      public org.ofbiz.core.entity.GenericValue getGenericValue()
      Specified by:
      getGenericValue in interface Project
      Returns:
      the GenericValue backing this project object
    • getLead

      public ApplicationUser getLead()
      Specified by:
      getLead in interface Project
      Returns:
      the Project Lead
    • setLead

      public void setLead(ApplicationUser lead)
    • getLeadUserName

      public String getLeadUserName()
      Specified by:
      getLeadUserName in interface Project
      Returns:
      the user name of the project lead
    • getAvatar

      @Nonnull public Avatar getAvatar()
      Description copied from interface: Project
      Gives the currently-configured Avatar for this project.
      Specified by:
      getAvatar in interface Project
      Returns:
      the current Avatar (or default if the current one is removed), never null.
    • getProjectLead

      public ApplicationUser getProjectLead()
      Specified by:
      getProjectLead in interface Project
      Returns:
      the Project Lead
    • getLeadUserKey

      public String getLeadUserKey()
      Specified by:
      getLeadUserKey in interface Project
      Returns:
      the Project Lead's userkey
    • getOriginalKey

      public String getOriginalKey()
      Specified by:
      getOriginalKey in interface Project
      Returns:
      the project key with which Project was originally created
    • isArchived

      public boolean isArchived()
      Specified by:
      isArchived in interface Project
      Returns:
      true if this project is archived.
    • getArchivedBy

      public ApplicationUser getArchivedBy()
      Specified by:
      getArchivedBy in interface Project
      Returns:
      the user who archived this project, or null if it wasn't archived.
    • getArchivedDate

      public Date getArchivedDate()
      Specified by:
      getArchivedDate in interface Project
      Returns:
      Date when this project was archived, or null if it wasn't archived.
    • setAvatar

      public void setAvatar(Avatar avatar)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setProjectTypeKey

      public void setProjectTypeKey(String projectTypeKey)
    • setArchived

      public void setArchived(boolean archived)
    • setArchivedBy

      public void setArchivedBy(ApplicationUser archivedBy)
    • setArchivedDate

      public void setArchivedDate(Date archivedDate)