1 8 9 package com.sleepycat.persist.evolve; 10 11 import java.util.Collections ; 12 import java.util.HashSet ; 13 import java.util.Set ; 14 15 31 public class EntityConverter extends Converter { 32 33 private static final long serialVersionUID = -988428985370593743L; 34 35 private Set <String > deletedKeys; 36 37 41 public EntityConverter(String entityClassName, 42 int classVersion, 43 Conversion conversion, 44 Set <String > deletedKeys) { 45 super(entityClassName, classVersion, null, conversion); 46 47 48 if (deletedKeys != null) { 49 this.deletedKeys = new HashSet (deletedKeys); 50 } else { 51 this.deletedKeys = Collections.emptySet(); 52 } 53 } 54 55 58 public Set <String > getDeletedKeys() { 59 return Collections.unmodifiableSet(deletedKeys); 60 } 61 62 67 @Override 68 public boolean equals(Object other) { 69 if (other instanceof EntityConverter) { 70 EntityConverter o = (EntityConverter) other; 71 return deletedKeys.equals(o.deletedKeys) && 72 super.equals(other); 73 } else { 74 return false; 75 } 76 } 77 78 @Override 79 public int hashCode() { 80 return deletedKeys.hashCode() + super.hashCode(); 81 } 82 83 @Override 84 public String toString() { 85 return "[EntityConverter " + super.toString() + 86 " DeletedKeys: " + deletedKeys + ']'; 87 } 88 } 89 | Popular Tags |