Class ConversionUtils
java.lang.Object
com.atlassian.crowd.embedded.core.util.ConversionUtils
Utility class for converting between model objects and embedded/application objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Group
Extracts a directory-specific model group from the givenInvalidGroupException
and converts it into a directory-agnostic embedded/application group.static Group
toEmbeddedGroup
(Group modelGroup) Converts a directory-specific model group into a directory-agnostic embedded/application group.toEmbeddedGroups
(List<Group> modelGroups) Converts a directory-specific model groups into a directory-agnostic embedded/application groups.static GroupWithAttributes
toEmbeddedGroupWithAttributes
(GroupWithAttributes modelGroup) Converts a directory-specific model group (with attributes) into a directory-agnostic embedded/application group (with attributes).toEmbeddedUsers
(List<User> modelUsers) Converts a list of model Users to a list of embedded Users.static MembershipQuery<Group>
toModelGroupMembershipQuery
(MembershipQuery embeddedQuery) static GroupQuery<Group>
toModelGroupQuery
(GroupQuery embeddedQuery) static MembershipQuery<User>
toModelUserMembershipQuery
(MembershipQuery embeddedQuery) toModelUserQuery
(UserQuery embeddedQuery)
-
Method Details
-
toEmbeddedGroup
Converts a directory-specific model group into a directory-agnostic embedded/application group.- Parameters:
modelGroup
- model group.- Returns:
- immutable clone meeting the minimum requirements for an embedded/application group.
-
toEmbeddedGroupWithAttributes
Converts a directory-specific model group (with attributes) into a directory-agnostic embedded/application group (with attributes).- Parameters:
modelGroup
- model group with attributes.- Returns:
- immutable clone meeting the minimum requirements for an embedded/application group with attributes.
-
toEmbeddedGroups
Converts a directory-specific model groups into a directory-agnostic embedded/application groups.- Parameters:
modelGroups
- model groups.- Returns:
- immutable clones meeting the minimum requirements for an embedded/application group.
-
getEmbeddedGroup
Extracts a directory-specific model group from the givenInvalidGroupException
and converts it into a directory-agnostic embedded/application group.This is normally used to construct an embedded
InvalidGroupException
- Parameters:
ex
- the InvalidGroupException- Returns:
- embedded/application group.
-
toModelUserQuery
- Parameters:
embeddedQuery
- query expected to return an embedded user.- Returns:
- equivalent query with the return type set to model users.
-
toModelGroupQuery
- Parameters:
embeddedQuery
- query expected to return an embedded group.- Returns:
- equivalent query with the return type set to model groups.
-
toModelUserMembershipQuery
- Parameters:
embeddedQuery
- query expected to return an embedded user.- Returns:
- equivalent query with the return type set to model users.
-
toModelGroupMembershipQuery
- Parameters:
embeddedQuery
- query expected to return an embedded group.- Returns:
- equivalent query with the return type set to model groups.
-
toEmbeddedUsers
Converts a list of model Users to a list of embedded Users.- Parameters:
modelUsers
- a list of model Users.- Returns:
- equivalent list of embedded Users
-