1 8 package com.sleepycat.je.recovery.stepwise; 9 10 import java.util.Arrays ; 11 12 import com.sleepycat.bind.tuple.IntegerBinding; 13 import com.sleepycat.je.DatabaseEntry; 14 15 19 public class TestData { 20 private DatabaseEntry key; 21 private DatabaseEntry data; 22 23 public TestData(DatabaseEntry key, DatabaseEntry data) { 24 this.key = new DatabaseEntry(key.getData()); 25 this.data = new DatabaseEntry(data.getData()); 26 } 27 28 public boolean equals(Object o ) { 29 if (this == o) 30 return true; 31 if (!(o instanceof TestData)) 32 return false; 33 34 TestData other = (TestData) o; 35 if (Arrays.equals(key.getData(), other.key.getData()) && 36 Arrays.equals(data.getData(), other.data.getData())) { 37 return true; 38 } else 39 return false; 40 } 41 42 public String toString() { 43 return " k=" + IntegerBinding.entryToInt(key) + 44 " d=" + IntegerBinding.entryToInt(data); 45 } 46 47 public int hashCode() { 48 return toString().hashCode(); 49 } 50 51 public DatabaseEntry getKey() { 52 return key; 53 } 54 55 public DatabaseEntry getData() { 56 return data; 57 } 58 } 59 | Popular Tags |