Package org.simpleframework.xml.core
Class Revision
- java.lang.Object
-
- org.simpleframework.xml.core.Revision
-
class Revision extends java.lang.Object
TheRevision
object is used represent the revision of a class as read from a version attribute. It determines the type of deserialization that takes place.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
equal
This is used to track the revision comparision of the class.
-
Constructor Summary
Constructors Constructor Description Revision()
Constructor of theRevision
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compare(java.lang.Object expected, java.lang.Object current)
This is used to compare the expected and current versions of the class.double
getDefault()
This is used to acquire the default revision.boolean
isEqual()
This returns the cached comparision of the revisions.
-
-
-
Method Detail
-
getDefault
public double getDefault()
This is used to acquire the default revision. The default revision is the revision expected if there is not attribute representing the version in the XML element for the object.- Returns:
- this returns the default version for the object
-
compare
public boolean compare(java.lang.Object expected, java.lang.Object current)
This is used to compare the expected and current versions of the class. Once compared the comparison result is cached within the revision class so that it can be used repeatedly.- Parameters:
expected
- this is the expected version of the classcurrent
- this is the current version of the class- Returns:
- this returns true if the versions are the same
-
isEqual
public boolean isEqual()
This returns the cached comparision of the revisions. This will be true if not comparison was performed. If however one was performed then this will represent the result.- Returns:
- this returns the cached version of the comparison
-
-