1 package org.enhydra.shark; 2 3 import org.enhydra.shark.api.client.wfservice.ParticipantMap; 4 5 9 public class ParticipantMapImpl 10 implements ParticipantMap { 11 12 private String participantId; 13 private String packageId; 14 private String processDefinitionId; 15 private String username; 16 private boolean isGroupUser; 17 18 protected ParticipantMapImpl() { 19 } 20 21 public void setParticipantId( String id ) { 22 this.participantId = id; 23 } 24 25 public String getParticipantId() { 26 return this.participantId; 27 } 28 29 public void setPackageId( String id ) { 30 this.packageId = id; 31 } 32 33 public String getPackageId() { 34 return this.packageId; 35 } 36 37 public void setProcessDefinitionId( String id ) { 38 this.processDefinitionId = id; 39 } 40 41 public String getProcessDefinitionId() { 42 return this.processDefinitionId; 43 } 44 45 public void setUsername( String username ) { 46 this.username = username; 47 } 48 49 public String getUsername() { 50 return this.username; 51 } 52 53 public boolean getIsGroupUser() { 54 return this.isGroupUser; 55 } 56 57 public void setIsGroupUser(boolean isGroupUser) { 58 this.isGroupUser = isGroupUser; 59 } 60 61 public boolean equals(Object obj) { 62 ParticipantMap pm; 63 if( obj instanceof ParticipantMap ) { 64 pm = ( ParticipantMap ) obj; 65 if( 66 compareValues(this.packageId, pm.getPackageId()) && 67 compareValues(this.participantId, pm.getParticipantId()) && 68 compareValues(this.processDefinitionId, pm.getProcessDefinitionId()) && 69 compareValues(this.username, pm.getUsername()) && 70 this.isGroupUser == pm.getIsGroupUser() ) 71 return true; 72 } 73 return false; 74 } 75 76 82 private boolean compareValues(Object valA, Object valB) { 83 boolean retVal = false; 84 85 if( valA == null && valB == null ) 86 retVal = true; 87 else if( valA == null && valB != null ) 88 retVal = false; 89 else if( valA != null && valB == null ) 90 retVal = false; 91 else if( valA.equals(valB) ) 92 retVal = true; 93 94 return retVal; 95 } 96 97 } 98 | Popular Tags |