Class EntityTranslator

java.lang.Object
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 Details

    • 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, @Nullable 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, 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, 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(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

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

      public static List<GroupWithAttributes> toGroupWithAttributesList(GroupEntityList groupEntityList)
      Transforms GroupEntityList into a list of groups with attributes.
    • toNameList

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

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

      public static List<UserWithAttributes> toUserWithAttributesList(UserEntityList userEntityList)
      Transforms UserEntityList into a list of users with attributes.
    • toNameList

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

      public static Events toEvents(EventEntityList eventEntityList)