Class Visibilities

java.lang.Object
com.atlassian.jira.bc.issue.visibility.Visibilities

@PublicApi public class Visibilities extends Object
Static factory methods to create Visibility instances. Methods which create a Visibility from a given groupLevel and roleLevelId or from a VisibilityJsonBean could return an InvalidVisibility when passed arguments was incorrect.
Since:
v6.4
  • Method Details

    • groupVisibility

      public static Visibility groupVisibility(String groupLevel)
    • roleVisibility

      public static Visibility roleVisibility(long roleId)
    • publicVisibility

      public static Visibility publicVisibility()
    • fromVisibilityBean

      public static Visibility fromVisibilityBean(VisibilityJsonBean visibilityBean, ProjectRoleManager projectRoleManager)
      Create a visibility level from VisibilityJsonBean
      Parameters:
      visibilityBean - is a base to create the Visibility.
      projectRoleManager - is used to retrieve an id of role from its name.
      Returns:
      a visibility based on the visibility bean. An InvalidVisibility may be returned if a role from the visibilityBean don't exist.
    • fromGroupAndRoleId

      public static Visibility fromGroupAndRoleId(@Nullable String groupLevel, @Nullable Long roleLevelId)
      Create a visibility level for a specified group or role.
      Parameters:
      groupLevel - contains a name of the group which members can view an element with this visibility.
      roleLevelId - contains an id of project role which members can view an element with this visibility.
      Returns:
      a GroupVisibility if groupLevel is defined, a RoleVisibility if roleLevelId is defined, a PublicVisibility if both parameters are nulls and an InvalidVisibility if both parameters are defined.
    • fromGroupAndStrRoleId

      public static Visibility fromGroupAndStrRoleId(@Nullable String groupLevel, @Nullable String roleLevelId)
      Create a visibility level for a specified group or role.
      Parameters:
      groupLevel - contains a name of the group which members can view an element with this visibility.
      roleLevelId - contains an string representation of id of project role which members can view an element with this visibility.
      Returns:
      a GroupVisibility if groupLevel is defined, a RoleVisibility if roleLevelId is defined, a PublicVisibility if both parameters are nulls and an InvalidVisibility if both parameters are defined or if passed roleLevelId can't be parsed to long.
    • fromGroupAndStrRoleId

      public static Visibility fromGroupAndStrRoleId(boolean levelPresent, @Nullable String groupLevel, @Nullable String roleLevelId)