@Test public void test() { assertFalse( performComparisons( "1.0.1", "1.0.1" ) ); assertFalse( performComparisons( "1.0.2", "1.0.1" ) ); assertTrue( performComparisons( "1.0.1", "1.0.2" ) ); assertTrue( performComparisons( "1.4.1", "1.5.0" ) ); assertTrue( performComparisons( "1.4.61", "1.5.0" ) ); assertFalse( performComparisons( "1", "1" ) ); assertFalse( performComparisons( "0", "1" ) ); assertFalse( performComparisons( "1", "7" ) ); assertFalse( performComparisons( "1", "17" ) ); assertFalse( performComparisons( "8", "17" ) ); assertFalse( performComparisons( "1.0", "1.0" ) ); assertFalse( performComparisons( "1.0.1", "1.0.1" ) ); assertFalse( performComparisons( "2.37.902.181.0.2.4", "2.37.902.181.0.2.4" ) ); assertFalse( performComparisons( "2.37.902.181.0.2.4", "2.37.902.181.0.2.5" ) ); assertFalse( performComparisons( "2.37.902-alpha.181-beta.0+build2.5", "2.37.902-alpha.181-beta.0+build2.5" ) ); assertFalse( performComparisons( "2.37.902-alpha.181-beta.0+build2.5", "2.37.902-alpha.181-beta.0+build2.7.34" ) ); assertTrue( performComparisons( "2.37.902-alpha.181-beta.0+build2.5", "2.37.902-alpha.181-beta.1+build2.7.34" ) ); assertFalse( performComparisons( "1.2.3", "1.3" ) ); assertTrue( performComparisons( "1.2", "1.2.1" ) ); assertTrue( performComparisons( "1.501", "1.2.1" ) ); assertTrue( performComparisons( "9999901", "1.2.1" ) ); assertFalse( performComparisons( "1.2.3-alpha.1", "1.2.3-alpha.1" ) ); assertTrue( performComparisons( "1.2.3-alpha.1", "1.2.3-alpha.2" ) ); assertFalse( performComparisons( "1.2.3-alpha.2", "1.2.3-alpha.1" ) ); assertTrue( performComparisons( "1.2.3-alpha.1", "1.2.3" ) ); assertFalse( performComparisons( "1.2.3", "1.2.3-alpha.1" ) ); }
public boolean performComparisons( String currentVersion, String checkVersion ) { BluesSemanticVersionData currentSemVer = new BluesSemanticVersionData(currentVersion); BluesSemanticVersionData checkSemVer = new BluesSemanticVersionData(checkVersion); return (checkSemVer.compareTo( currentSemVer ) > 0); }
BluesSpigetSemVerComparator extends VersionComparator { public boolean performComparisons( String currentVersion, String checkVersion ) { BluesSemanticVersionData currentSemVer = new BluesSemanticVersionData(currentVersion); BluesSemanticVersionData checkSemVer = new BluesSemanticVersionData(checkVersion); return (checkSemVer.compareTo( currentSemVer ) > 0); } }
BluesSpigetSemVerComparator extends VersionComparator { public boolean performComparisons( String currentVersion, String checkVersion ) { BluesSemanticVersionData currentSemVer = new BluesSemanticVersionData(currentVersion); BluesSemanticVersionData checkSemVer = new BluesSemanticVersionData(checkVersion); return (checkSemVer.compareTo( currentSemVer ) > 0); }  }
BluesSpigetSemVerComparator extends VersionComparator { public boolean performComparisons( String currentVersion, String checkVersion ) { BluesSemanticVersionData currentSemVer = new BluesSemanticVersionData(currentVersion); BluesSemanticVersionData checkSemVer = new BluesSemanticVersionData(checkVersion); return (checkSemVer.compareTo( currentSemVer ) > 0); }  @Override boolean isNewer(String currentVersion, String checkVersion); boolean performComparisons( String currentVersion, String checkVersion ); int compareTo( String currentVersion, String checkVersion ); int compareMCVersionTo( String checkVersion ); }
BluesSpigetSemVerComparator extends VersionComparator { public boolean performComparisons( String currentVersion, String checkVersion ) { BluesSemanticVersionData currentSemVer = new BluesSemanticVersionData(currentVersion); BluesSemanticVersionData checkSemVer = new BluesSemanticVersionData(checkVersion); return (checkSemVer.compareTo( currentSemVer ) > 0); }  @Override boolean isNewer(String currentVersion, String checkVersion); boolean performComparisons( String currentVersion, String checkVersion ); int compareTo( String currentVersion, String checkVersion ); int compareMCVersionTo( String checkVersion );  }