1 8 9 package com.sleepycat.persist.evolve; 10 11 46 public class Renamer extends Mutation { 47 48 private static final long serialVersionUID = 2238151684405810427L; 49 50 private String newName; 51 52 56 public Renamer(String fromClass, int fromVersion, String toClass) { 57 super(fromClass, fromVersion, null); 58 newName = toClass; 59 } 60 61 65 public Renamer(String declaringClass, int declaringClassVersion, 66 String fromField, String toField) { 67 super(declaringClass, declaringClassVersion, fromField); 68 newName = toField; 69 } 70 71 74 public String getNewName() { 75 return newName; 76 } 77 78 82 @Override 83 public boolean equals(Object other) { 84 if (other instanceof Renamer) { 85 Renamer o = (Renamer) other; 86 return newName.equals(o.newName) && 87 super.equals(other); 88 } else { 89 return false; 90 } 91 } 92 93 @Override 94 public int hashCode() { 95 return newName.hashCode() + super.hashCode(); 96 } 97 98 @Override 99 public String toString() { 100 return "[Renamer " + super.toString() + 101 " NewName: " + newName + ']'; 102 } 103 } 104 | Popular Tags |