Package com.sleepycat.persist.evolve
Class Renamer
java.lang.Object
com.sleepycat.persist.evolve.Mutation
com.sleepycat.persist.evolve.Renamer
- All Implemented Interfaces:
Serializable
A mutation for renaming a class or field without changing the instance or
field value. For example:
package my.package;
// The old class. Version 0 is implied.
//
@Entity
class Person {
String name;
}
// The new class. A new version number must be assigned.
//
@Entity(version=1)
class Human {
String fullName;
}
// Add the mutations.
//
Mutations mutations = new Mutations();
mutations.addRenamer(new Renamer("my.package.Person", 0,
Human.class.getName()));
mutations.addRenamer(new Renamer("my.package.Person", 0,
"name", "fullName"));
// Configure the mutations as described here.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a mutation for renaming the class of all instances of the given class version.Creates a mutation for renaming the given field for all instances of the given class version. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the new class name is equal in this object and given object, and if theMutation.equals(java.lang.Object)method returns true.Returns the new class or field name specified in the constructor.inthashCode()toString()Methods inherited from class com.sleepycat.persist.evolve.Mutation
getClassName, getClassVersion, getFieldName
-
Constructor Details
-
Renamer
Creates a mutation for renaming the class of all instances of the given class version. -
Renamer
Creates a mutation for renaming the given field for all instances of the given class version.
-
-
Method Details
-
getNewName
Returns the new class or field name specified in the constructor. -
equals
Returns true if the new class name is equal in this object and given object, and if theMutation.equals(java.lang.Object)method returns true. -
hashCode
public int hashCode() -
toString
-