Coverage Report - org.kuali.rice.kew.dto.ResponsiblePartyDTO
 
Classes in this File Line Coverage Branch Coverage Complexity
ResponsiblePartyDTO
0%
0/28
0%
0/6
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 
 21  
 /**
 22  
  * Transport for representing a principal, group, or role associated with and request
 23  
  * 
 24  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 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  
 }