1 22 package org.jboss.test.hibernate.timers.interfaces; 23 24 import java.io.Serializable ; 25 26 32 public class Key implements Serializable 33 { 34 private static final long serialVersionUID = 1L; 35 36 private String key1; 37 private long key2; 38 39 public Key() 40 { 41 } 42 public Key(String key1, long key2) 43 { 44 this.key1 = key1; 45 this.key2 = key2; 46 } 47 48 public String getKey1() 49 { 50 return key1; 51 } 52 public void setKey1(String key1) 53 { 54 this.key1 = key1; 55 } 56 57 public long getKey2() 58 { 59 return key2; 60 } 61 public void setKey2(long key2) 62 { 63 this.key2 = key2; 64 } 65 66 public int hashCode() 67 { 68 int hc = (int) key2; 69 return key1.hashCode() + hc; 70 } 71 public boolean equals(Object o) 72 { 73 Key k = (Key) o; 74 return key1.equals(k.key1) && key2 == k.key2; 75 } 76 } 77 | Popular Tags |