Class EntityTranslator
java.lang.Object
com.atlassian.crowd.integration.rest.util.EntityTranslator
Translates between REST entities and
com.atlassian.crowd.model
classes.- Since:
- v2.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic Events
toEvents
(EventEntityList eventEntityList) static GroupEntity
toGroupEntity
(Group group) Translates a Group to a GroupEntity.static GroupEntity
toGroupEntity
(Group group, Attributes attributes) Translates a Group with Attributes to a GroupEntity.toGroupList
(GroupEntityList groupEntityList) Transforms GroupEntityList into a list of groups.static List<GroupWithAttributes>
toGroupWithAttributesList
(GroupEntityList groupEntityList) Transforms GroupEntityList into a list of groups with attributes.toMultiValuedAttributeEntityList
(Attributes attributes) Translates Attributes to MultiValuedAttributeEntityList.toMultiValuedAttributeEntityList
(Map<String, Set<String>> attributes) Translates Attributes to MultiValuedAttributeEntityList.toNameList
(GroupEntityList groupEntityList) Transforms GroupEntityList into a list of group names.toNameList
(UserEntityList userEntityList) Transforms UserEntityList into a list of usernames.static UserEntity
toUserEntity
(User user) Translates a User to a UserEntity.static UserEntity
toUserEntity
(User user, Attributes attributes) Translates a User with Attributes to a UserEntity.static UserEntity
toUserEntity
(User user, PasswordCredential passwordCredential) Translates a User to a UserEntity.toUserList
(UserEntityList userEntityList) Transforms UserEntityList into a list of users.static List<UserWithAttributes>
toUserWithAttributesList
(UserEntityList userEntityList) Transforms UserEntityList into a list of users with attributes.
-
Method Details
-
toUserEntity
Translates a User to a UserEntity.- Parameters:
user
- User to convert- Returns:
- UserEntity if user is not null, otherwise null
-
toUserEntity
Translates a User to a UserEntity.- Parameters:
user
- User to convertpasswordCredential
- user password- Returns:
- UserEntity if user is not null, otherwise null
-
toUserEntity
Translates a User with Attributes to a UserEntity.- Parameters:
user
- Userattributes
- attributes of the user.- Returns:
- UserEntity if user is not null, otherwise null
-
toGroupEntity
Translates a Group to a GroupEntity.- Parameters:
group
- Group to convert- Returns:
- GroupEntity
-
toGroupEntity
Translates a Group with Attributes to a GroupEntity.- Parameters:
group
- Groupattributes
- attributes of the group.- Returns:
- GroupEntity
-
toMultiValuedAttributeEntityList
public static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(Attributes attributes) Translates Attributes to MultiValuedAttributeEntityList. Sorts the attributes in ascending order.- Parameters:
attributes
- Attributes of an entity- Returns:
- MultiValuedAttributeEntityList sorted in ascending order if attributes is not null, otherwise null
-
toMultiValuedAttributeEntityList
public static MultiValuedAttributeEntityList toMultiValuedAttributeEntityList(Map<String, Set<String>> attributes) Translates Attributes to MultiValuedAttributeEntityList. Sorts the attributes in ascending order.- Parameters:
attributes
- attributes of an entity- Returns:
- MultiValuedAttributeEntityList sorted in ascending order if attributes is not null, otherwise null
-
toGroupList
Transforms GroupEntityList into a list of groups. -
toGroupWithAttributesList
Transforms GroupEntityList into a list of groups with attributes. -
toNameList
Transforms GroupEntityList into a list of group names. -
toUserList
Transforms UserEntityList into a list of users. -
toUserWithAttributesList
Transforms UserEntityList into a list of users with attributes. -
toNameList
Transforms UserEntityList into a list of usernames. -
toEvents
-