java.io.Serializable
EntityConverter
public class Converter extends Mutation
package my.package;
// The old class. Version 0 is implied.
//
@Entity
class Person {
// ...
}
// The new class. A new version number must be assigned.
//
@Entity(version=1)
class Person {
// Incompatible changes were made here...
}
// Add a converter mutation.
//
Mutations mutations = new Mutations();
mutations.addConverter(new Converter(Person.class.getName(), 0,
new MyConversion()));
// Configure the mutations as described here
.
See Conversion
for more information.
Class Evolution
,
Serialized FormConstructor | Description |
---|---|
Converter(java.lang.String className,
int classVersion,
Conversion conversion) |
Creates a mutation for converting all instances of the given class
version to the current version of the class.
|
Converter(java.lang.String declaringClassName,
int declaringClassVersion,
java.lang.String fieldName,
Conversion conversion) |
Creates a mutation for converting all values of the given field in the
given class version to a type compatible with the current declared type
of the field.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object other) |
Returns true if the conversion objects are equal in this object and
given object, and if the
Mutation.equals(java.lang.Object) superclass method
returns true. |
Conversion |
getConversion() |
Returns the converter instance specified to the constructor.
|
int |
hashCode() |
|
java.lang.String |
toString() |
getClassName, getClassVersion, getFieldName
public Converter(java.lang.String className, int classVersion, Conversion conversion)
className
- the class to which this mutation applies.classVersion
- the class version to which this mutation applies.conversion
- converter instance.public Converter(java.lang.String declaringClassName, int declaringClassVersion, java.lang.String fieldName, Conversion conversion)
declaringClassName
- the class to which this mutation applies.declaringClassVersion
- the class version to which this mutation
applies.fieldName
- field name to which this mutation applies.conversion
- converter instance.public Conversion getConversion()
public boolean equals(java.lang.Object other)
Mutation.equals(java.lang.Object)
superclass method
returns true.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.