1 13 14 15 package org.ejbca.core.ejb.authorization; 16 17 import org.ejbca.core.model.authorization.AccessRule; 18 19 29 30 public final class AccessRulesPK implements java.io.Serializable { 31 32 public int primKey; 33 34 35 public AccessRulesPK(java.lang.String admingroupname, int caid, AccessRule accessrule) { 36 this.primKey = 37 ((admingroupname==null?0:admingroupname.hashCode()) 38 ^ 39 (caid) 40 ^ 41 (accessrule.getAccessRule()==null?0:accessrule.getAccessRule().hashCode())); 42 } 43 44 public AccessRulesPK() { 45 } 46 47 public int getPrimKey() 48 { 49 return primKey; 50 } 51 52 public void setpK(int primKey) 53 { 54 this.primKey = primKey; 55 } 56 57 60 public boolean equals(java.lang.Object otherOb) { 61 if (!(otherOb instanceof org.ejbca.core.ejb.authorization.AccessRulesPK)) { 62 return false; 63 } 64 org.ejbca.core.ejb.authorization.AccessRulesPK other = (org.ejbca.core.ejb.authorization.AccessRulesPK) otherOb; 65 return (this.primKey==other.primKey); 66 } 67 68 71 public int hashCode() { 72 return this.primKey; 73 } 74 75 76 public String toString() 77 { 78 StringBuffer toStringValue = new StringBuffer ("[."); 79 toStringValue.append(this.primKey).append('.'); 80 toStringValue.append(']'); 81 return toStringValue.toString(); 82 } 83 } 84 | Popular Tags |