-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
763 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/de/aservo/confapi/crowd/model/UsersBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package de.aservo.confapi.crowd.model; | ||
|
||
import de.aservo.confapi.commons.constants.ConfAPI; | ||
import de.aservo.confapi.commons.model.UserBean; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.util.Collection; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@XmlRootElement(name = ConfAPI.USERS) | ||
public class UsersBean { | ||
|
||
@XmlElement | ||
private Collection<UserBean> users; | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/de/aservo/confapi/crowd/model/util/UserBeanUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package de.aservo.confapi.crowd.model.util; | ||
|
||
import com.atlassian.crowd.model.user.User; | ||
import de.aservo.confapi.commons.model.UserBean; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public class UserBeanUtil { | ||
|
||
/** | ||
* Build user bean. | ||
* | ||
* @param user the user | ||
* @return the user bean | ||
*/ | ||
@Nullable | ||
public static UserBean toUserBean( | ||
@Nullable final User user) { | ||
|
||
if (user == null) { | ||
return null; | ||
} | ||
|
||
final UserBean userBean = new UserBean(); | ||
userBean.setUsername(user.getName()); | ||
userBean.setFullName(user.getDisplayName()); | ||
userBean.setEmail(user.getEmailAddress()); | ||
|
||
return userBean; | ||
} | ||
|
||
private UserBeanUtil() { | ||
} | ||
|
||
} |
Oops, something went wrong.