Class ProjectUtils


  • public class ProjectUtils
    extends java.lang.Object
    Project related utility methods
    • Field Detail

      • PERSONAL_PROJECT_POSTFIX_REGEX

        public static final java.lang.String PERSONAL_PROJECT_POSTFIX_REGEX
        See Also:
        Constant Field Values
      • LINE_START_SYMBOL

        public static final java.lang.String LINE_START_SYMBOL
        See Also:
        Constant Field Values
    • Method Detail

      • defaultProjectAttributes

        public static java.util.Set<ProjectAttribute> defaultProjectAttributes​(Project project,
                                                                               java.util.Set<Attribute> defaultAttributes)
        Returns:
        Generated default project configuration
      • excludeProjectRecipients

        public static Project excludeProjectRecipients​(java.lang.Iterable<User> users,
                                                       Project project)
        Exclude specified project recipients
        Parameters:
        users -
        project -
        Returns:
      • updateProjectRecipients

        public static Project updateProjectRecipients​(java.lang.String oldEmail,
                                                      java.lang.String newEmail,
                                                      Project project)
        Update specified project recipient
        Parameters:
        oldEmail -
        newEmail -
        project -
        Returns:
      • doesHaveUser

        public static boolean doesHaveUser​(Project project,
                                           java.lang.String user)
        Checks if the user is assigned on project
        Parameters:
        project - Specified project
        user - User login
        Returns:
        True, if exists
      • findUserConfigByLogin

        @Nullable
        public static ProjectUser findUserConfigByLogin​(Project project,
                                                        java.lang.String user)
        Finds UserConfig for specified login. Returns null if it doesn't exists.
        Parameters:
        user - Login for search
        Returns:
        UserConfig for specified login
      • isAssignedToProject

        public static boolean isAssignedToProject​(User user,
                                                  java.lang.Long projectId)
        Checks if user is assigned to specified project
        Parameters:
        user - User
        projectId - ID of project
        Returns:
        true if assigned, otherwise false
      • getConfigParameters

        public static java.util.Map<java.lang.String,​java.lang.String> getConfigParameters​(java.util.Set<ProjectAttribute> projectAttributes)
      • getConfigParametersByPrefix

        public static java.util.Map<java.lang.String,​java.lang.String> getConfigParametersByPrefix​(java.util.Set<ProjectAttribute> projectAttributes,
                                                                                                         java.lang.String prefix)
      • isPersonalForUser

        public static boolean isPersonalForUser​(ProjectType projectType,
                                                java.lang.String projectName,
                                                java.lang.String username)
      • extractAttributeValue

        public static java.util.Optional<java.lang.String> extractAttributeValue​(Project project,
                                                                                 ProjectAttributeEnum attribute)
      • getOwner

        public static java.lang.String getOwner()