1 13 14 15 package org.ejbca.core.ejb.authorization; 16 17 27 public final class AdminEntityPK implements java.io.Serializable { 28 29 public int primKey; 30 31 public AdminEntityPK(String admingroupname, int caid, int matchwith, int matchtype, String matchvalue) { 32 this.primKey = 33 ((admingroupname==null?0:admingroupname.hashCode()) 34 ^ 35 (caid) 36 ^ 37 (matchwith) 38 ^ 39 (matchvalue==null?0:matchvalue.hashCode()) 40 ^ 41 (matchtype)); 42 } 43 44 public AdminEntityPK() { 45 } 46 47 public int getPrimKey() 48 { 49 return primKey; 50 } 51 52 public void setPrimKey(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.AdminEntityPK)) { 62 return false; 63 } 64 org.ejbca.core.ejb.authorization.AdminEntityPK other = (org.ejbca.core.ejb.authorization.AdminEntityPK) 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 } 85 | Popular Tags |