@PublicApi public class Visibilities extends Object
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.Modifier and Type | Method and Description |
---|---|
static 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 from
VisibilityJsonBean |
static Visibility |
groupVisibility(String groupLevel) |
static Visibility |
publicVisibility() |
static Visibility |
roleVisibility(long roleId) |
public static Visibility groupVisibility(String groupLevel)
public static Visibility roleVisibility(long roleId)
public static Visibility publicVisibility()
public static Visibility fromVisibilityBean(VisibilityJsonBean visibilityBean, ProjectRoleManager projectRoleManager)
VisibilityJsonBean
visibilityBean
- is a base to create the Visibility.projectRoleManager
- is used to retrieve an id of role from its name.InvalidVisibility
may be returned if a role from the visibilityBean don't exist.public static Visibility fromGroupAndRoleId(@Nullable String groupLevel, @Nullable Long roleLevelId)
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.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.public static Visibility fromGroupAndStrRoleId(@Nullable String groupLevel, @Nullable String roleLevelId)
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.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.public static Visibility fromGroupAndStrRoleId(boolean levelPresent, @Nullable String groupLevel, @Nullable String roleLevelId)
Copyright © 2002-2019 Atlassian. All Rights Reserved.