| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
package org.kuali.rice.kew.dto; |
| 18 | |
|
| 19 | |
import java.io.Serializable; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | 0 | public class ResponsiblePartyDTO implements Serializable { |
| 27 | |
|
| 28 | |
static final long serialVersionUID = 5716093378476396724L; |
| 29 | |
|
| 30 | |
private String principalId; |
| 31 | |
private String roleName; |
| 32 | |
private String groupId; |
| 33 | |
|
| 34 | |
public boolean isPrincipal() { |
| 35 | 0 | return principalId != null; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public boolean isGroup() { |
| 39 | 0 | return groupId != null; |
| 40 | |
} |
| 41 | |
|
| 42 | |
public boolean isRole() { |
| 43 | 0 | return roleName != null; |
| 44 | |
} |
| 45 | |
|
| 46 | |
public String getPrincipalId() { |
| 47 | 0 | return principalId; |
| 48 | |
} |
| 49 | |
|
| 50 | |
public void setPrincipalId(String principalId) { |
| 51 | 0 | this.principalId = principalId; |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
public String getRoleName() { |
| 55 | 0 | return roleName; |
| 56 | |
} |
| 57 | |
|
| 58 | |
public void setRoleName(String roleName) { |
| 59 | 0 | this.roleName = roleName; |
| 60 | 0 | } |
| 61 | |
public String getGroupId() { |
| 62 | 0 | return this.groupId; |
| 63 | |
} |
| 64 | |
|
| 65 | |
public void setGroupId(String groupId) { |
| 66 | 0 | this.groupId = groupId; |
| 67 | 0 | } |
| 68 | |
|
| 69 | |
public static ResponsiblePartyDTO fromGroupId(String groupId) { |
| 70 | 0 | ResponsiblePartyDTO responsibleParty = new ResponsiblePartyDTO(); |
| 71 | 0 | responsibleParty.setGroupId(groupId); |
| 72 | 0 | return responsibleParty; |
| 73 | |
} |
| 74 | |
|
| 75 | |
public static ResponsiblePartyDTO fromPrincipalId(String principalId) { |
| 76 | 0 | ResponsiblePartyDTO responsibleParty = new ResponsiblePartyDTO(); |
| 77 | 0 | responsibleParty.setPrincipalId(principalId); |
| 78 | 0 | return responsibleParty; |
| 79 | |
} |
| 80 | |
|
| 81 | |
public static ResponsiblePartyDTO fromRoleName(String roleName) { |
| 82 | 0 | ResponsiblePartyDTO responsibleParty = new ResponsiblePartyDTO(); |
| 83 | 0 | responsibleParty.setRoleName(roleName); |
| 84 | 0 | return responsibleParty; |
| 85 | |
} |
| 86 | |
|
| 87 | |
public String toString() { |
| 88 | 0 | StringBuffer sb = new StringBuffer("["); |
| 89 | 0 | sb.append("principalId=").append(getPrincipalId()).append(", "); |
| 90 | 0 | sb.append("groupId=").append(getGroupId()).append(", "); |
| 91 | 0 | sb.append("roleName=").append(getRoleName()); |
| 92 | 0 | sb.append("]"); |
| 93 | 0 | return sb.toString(); |
| 94 | |
} |
| 95 | |
|
| 96 | |
} |