com.atlassian.jira.user.util
Class OSUserConverter

java.lang.Object
  extended by com.atlassian.jira.user.util.OSUserConverter

public class OSUserConverter
extends Object

Utility to assist in the migration of code from the OSUser to the Crowd User API.

Since:
v4.3

Constructor Summary
OSUserConverter()
           
 
Method Summary
static Group convertToOSGroup(com.atlassian.crowd.embedded.api.Group crowdGroup)
          Convert a Crowd Group to an OSUser Group If a group is already an OSGroup the group will be returned unchanged.
static Set<Group> convertToOSGroups(Iterable<com.atlassian.crowd.embedded.api.Group> crowdGroups)
          Convert a collection of Crowd Groups to OS User Groups If any group is already an OSGroup that group will be returned unchanged.
static User convertToOSUser(com.atlassian.crowd.embedded.api.User crowdUser)
          Convert a Crowd User to an OSUser If a user is already an OSUser the user will be returned unchanged.
static List<User> convertToOSUserList(Iterable<com.atlassian.crowd.embedded.api.User> crowdUsers)
          Convert a Crowd User collection to a List of OSUser.
static Set<User> convertToOSUserSet(Iterable<com.atlassian.crowd.embedded.api.User> crowdUsers)
          Convert a Crowd User collection to a Set of OSUser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSUserConverter

public OSUserConverter()
Method Detail

convertToOSUserSet

public static Set<User> convertToOSUserSet(Iterable<com.atlassian.crowd.embedded.api.User> crowdUsers)
Convert a Crowd User collection to a Set of OSUser. If any user is already an OSUser that user will be returned unchanged.

Parameters:
crowdUsers - A bunch of Crowd users
Returns:
A Set of OS User objects.

convertToOSUserList

public static List<User> convertToOSUserList(Iterable<com.atlassian.crowd.embedded.api.User> crowdUsers)
Convert a Crowd User collection to a List of OSUser. If any user is already an OSUser that user will be returned unchanged.

Parameters:
crowdUsers - A bunch of Crowd users
Returns:
A List of OS User objects (in the same order as the original collection).

convertToOSUser

public static User convertToOSUser(com.atlassian.crowd.embedded.api.User crowdUser)
Convert a Crowd User to an OSUser If a user is already an OSUser the user will be returned unchanged.

Parameters:
crowdUser - A Crowd User Object
Returns:
OS User object.

convertToOSGroups

public static Set<Group> convertToOSGroups(Iterable<com.atlassian.crowd.embedded.api.Group> crowdGroups)
Convert a collection of Crowd Groups to OS User Groups If any group is already an OSGroup that group will be returned unchanged.

Parameters:
crowdGroups - A bunch of Crowd groups
Returns:
A collection of OS Group objects.

convertToOSGroup

public static Group convertToOSGroup(com.atlassian.crowd.embedded.api.Group crowdGroup)
Convert a Crowd Group to an OSUser Group If a group is already an OSGroup the group will be returned unchanged.

Parameters:
crowdGroup - A Crowd Group Object
Returns:
OS User Group object.


Copyright © 2002-2011 Atlassian. All Rights Reserved.