Package io.jsondb
Class DefaultSchemaVersionComparator
- java.lang.Object
-
- io.jsondb.DefaultSchemaVersionComparator
-
- All Implemented Interfaces:
java.util.Comparator<java.lang.String>
public class DefaultSchemaVersionComparator extends java.lang.Object implements java.util.Comparator<java.lang.String>A default schema version comparator that expects the version to be in x.y.z form where each of the digits is strictly a integer.
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemaVersionComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.lang.String expected, java.lang.String actual)compare the expected version with the actual version.
-
-
-
Method Detail
-
compare
public int compare(java.lang.String expected, java.lang.String actual)compare the expected version with the actual version. Checkout: http://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java- Specified by:
comparein interfacejava.util.Comparator<java.lang.String>- Parameters:
expected- the version that is obtained from @Document annotationactual- the version that is read from the .json file- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
-