|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.user.UserFilterUtils
public class UserFilterUtils
Some utility functions for dealing with UserFilter
instances.
Field Summary | |
---|---|
static com.google.common.base.Function<ProjectRole,Long> |
GET_ROLE_ID_FUNCTION
|
Constructor Summary | |
---|---|
UserFilterUtils()
|
Method Summary | |
---|---|
static Set<String> |
filterRemovedGroups(Set<String> groups,
Collection<com.atlassian.crowd.embedded.api.Group> allGroups)
|
static UserFilter |
fromJson(JSONObject json)
|
static UserFilter |
fromJsonString(String jsonString)
|
static UserFilter |
getFilterWithoutRemovedGroupsAndRoles(UserFilter filter,
Collection<com.atlassian.crowd.embedded.api.Group> allGroups,
ProjectRoleManager projectRoleManager)
|
static List<ProjectRole> |
getProjectRoles(ProjectRoleManager projectRoleManager,
Set<Long> roleIds)
Get the ProjectRole objects sorted by role name. |
static UserFilter |
intersectGroups(UserFilter userFilter,
Set<String> groups)
Intersect the groups of the userFilter with groups . |
static List<String> |
sortGroups(Collection<String> groups)
|
static JSONObject |
toJson(UserFilter userFilter,
ProjectRoleManager projectRoleManager)
Convert the userFilter to JSONObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final com.google.common.base.Function<ProjectRole,Long> GET_ROLE_ID_FUNCTION
Constructor Detail |
---|
public UserFilterUtils()
Method Detail |
---|
public static UserFilter intersectGroups(UserFilter userFilter, Set<String> groups)
groups
.
If the filter is disabled and groups
is not empty, a new filter that's enabled and with the groups will be returned.
If the filter is enabled, its groups will be intersected with the incoming one and a new filter with the intersection will be returned.
userFilter
- the user filter to applied the intersection of groups. Will not be changedgroups
- a set of groups to be intersected with the filter
public static JSONObject toJson(UserFilter userFilter, ProjectRoleManager projectRoleManager) throws JSONException
userFilter
to JSONObject
userFilter
- the user filter to be convertedprojectRoleManager
- optional, if provided, will be used to filter invalid project roles
JSONException
public static UserFilter fromJson(JSONObject json) throws JSONException
JSONException
public static UserFilter fromJsonString(String jsonString) throws JSONException
JSONException
public static UserFilter getFilterWithoutRemovedGroupsAndRoles(UserFilter filter, Collection<com.atlassian.crowd.embedded.api.Group> allGroups, ProjectRoleManager projectRoleManager)
public static Set<String> filterRemovedGroups(Set<String> groups, Collection<com.atlassian.crowd.embedded.api.Group> allGroups)
public static List<ProjectRole> getProjectRoles(ProjectRoleManager projectRoleManager, Set<Long> roleIds)
ProjectRole
objects sorted by role name.
public static List<String> sortGroups(Collection<String> groups)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |