Class Visibilities
java.lang.Object
com.atlassian.jira.bc.issue.visibility.Visibilities
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 Summary
Modifier and TypeMethodDescriptionstatic Visibility
fromGroupAndRoleId
(String groupLevel, Long roleLevelId) Create a visibility level for a specified group or role.static Visibility
fromGroupAndStrRoleId
(boolean levelPresent, String groupLevel, String roleLevelId) static Visibility
fromGroupAndStrRoleId
(String groupLevel, String roleLevelId) Create a visibility level for a specified group or role.static Visibility
fromVisibilityBean
(VisibilityJsonBean visibilityBean, ProjectRoleManager projectRoleManager) Create a visibility level fromVisibilityJsonBean
static Visibility
groupVisibility
(String groupLevel) static Visibility
static Visibility
roleVisibility
(long roleId)
-
Method Details
-
groupVisibility
-
roleVisibility
-
publicVisibility
-
fromVisibilityBean
public static Visibility fromVisibilityBean(VisibilityJsonBean visibilityBean, ProjectRoleManager projectRoleManager) Create a visibility level fromVisibilityJsonBean
- 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, aRoleVisibility
if roleLevelId is defined, aPublicVisibility
if both parameters are nulls and anInvalidVisibility
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, aRoleVisibility
if roleLevelId is defined, aPublicVisibility
if both parameters are nulls and anInvalidVisibility
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)
-