com.atlassian.crowd.integration.rest.util
Class EntityTranslator

java.lang.Object
  extended by com.atlassian.crowd.integration.rest.util.EntityTranslator

public class EntityTranslator
extends Object

Translates between REST entities and com.atlassian.crowd.model classes.

Since:
v2.1

Method Summary
static Events toEvents(EventEntityList eventEntityList)
           
static GroupEntity toGroupEntity(Group group)
          Translates a Group to a GroupEntity.
static GroupEntity toGroupEntity(Group group, com.atlassian.crowd.embedded.api.Attributes attributes)
          Translates a Group with Attributes to a GroupEntity.
static List<Group> toGroupList(GroupEntityList groupEntityList)
          Transforms GroupEntityList to a list of groups.
static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(com.atlassian.crowd.embedded.api.Attributes attributes)
          Translates Attributes to MultiValuedAttributeEntityList.
static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(Map<String,Set<String>> attributes)
          Translates Attributes to MultiValuedAttributeEntityList.
static List<String> toNameList(GroupEntityList groupEntityList)
          Transforms GroupEntityList to a list of group names.
static List<String> toNameList(UserEntityList userEntityList)
          Transforms UserEntityList to a list of usernames.
static UserEntity toUserEntity(User user)
          Translates a User to a UserEntity.
static UserEntity toUserEntity(User user, com.atlassian.crowd.embedded.api.Attributes attributes)
          Translates a User with Attributes to a UserEntity.
static UserEntity toUserEntity(User user, com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential)
          Translates a User to a UserEntity.
static List<User> toUserList(UserEntityList userEntityList)
          Transforms UserEntityList to a list of users.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toUserEntity

public static UserEntity toUserEntity(User user)
Translates a User to a UserEntity.

Parameters:
user - User to convert
Returns:
UserEntity if user is not null, otherwise null

toUserEntity

public static UserEntity toUserEntity(User user,
                                      com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential)
Translates a User to a UserEntity.

Parameters:
user - User to convert
passwordCredential - user password
Returns:
UserEntity if user is not null, otherwise null

toUserEntity

public static UserEntity toUserEntity(User user,
                                      com.atlassian.crowd.embedded.api.Attributes attributes)
Translates a User with Attributes to a UserEntity.

Parameters:
user - User
attributes - attributes of the user.
Returns:
UserEntity if user is not null, otherwise null

toGroupEntity

public static GroupEntity toGroupEntity(Group group)
Translates a Group to a GroupEntity.

Parameters:
group - Group to convert
Returns:
GroupEntity

toGroupEntity

public static GroupEntity toGroupEntity(Group group,
                                        com.atlassian.crowd.embedded.api.Attributes attributes)
Translates a Group with Attributes to a GroupEntity.

Parameters:
group - Group
attributes - attributes of the group.
Returns:
GroupEntity

toMultiValuedAttributeEntityList

public static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(com.atlassian.crowd.embedded.api.Attributes attributes)
Translates Attributes to MultiValuedAttributeEntityList.

Parameters:
attributes - Attributes of an entity
Returns:
MultiValuedAttributeEntityList if attributes is not null, otherwise null

toMultiValuedAttributeEntityList

public static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(Map<String,Set<String>> attributes)
Translates Attributes to MultiValuedAttributeEntityList.

Parameters:
attributes - Attributes of an entity
Returns:
MultiValuedAttributeEntityList if attributes is not null, otherwise null

toGroupList

public static List<Group> toGroupList(GroupEntityList groupEntityList)
Transforms GroupEntityList to a list of groups.

Parameters:
groupEntityList - GroupEntityList to transform
Returns:
list of groups

toNameList

public static List<String> toNameList(GroupEntityList groupEntityList)
Transforms GroupEntityList to a list of group names.

Parameters:
groupEntityList - GroupEntityList to transform
Returns:
list of group names

toUserList

public static List<User> toUserList(UserEntityList userEntityList)
Transforms UserEntityList to a list of users.

Parameters:
userEntityList - UserEntityList to transform
Returns:
list of users

toNameList

public static List<String> toNameList(UserEntityList userEntityList)
Transforms UserEntityList to a list of usernames.

Parameters:
userEntityList - UserEntityList to transform
Returns:
list of usernames

toEvents

public static Events toEvents(EventEntityList eventEntityList)


Copyright © 2014 Atlassian. All Rights Reserved.