Class Revision

java.lang.Object
org.simpleframework.xml.core.Revision

class Revision extends Object
The Revision 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
    This is used to track the revision comparision of the class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor of the Revision object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    compare(Object expected, Object current)
    This is used to compare the expected and current versions of the class.
    double
    This is used to acquire the default revision.
    boolean
    This returns the cached comparision of the revisions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • equal

      private boolean equal
      This is used to track the revision comparision of the class.
  • Constructor Details

    • Revision

      public Revision()
      Constructor of the Revision object. This is used to create a comparator object that will compare and cache the comparison of the expected and current version of the class.
  • Method Details

    • 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(Object expected, 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 class
      current - 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