6baf952904
Reworked whole Version Checker with an extensible interface to add any other service later on easier. The version checker now has its own config file, to collect the different options and extract them from the main config file. In that you can specify how fine the versions should be checked.
36 lines
690 B
Java
36 lines
690 B
Java
package appeng.services.version;
|
|
|
|
|
|
/**
|
|
* AE prints version like rv2-beta-8
|
|
* GitHub prints version like rv2.beta.8
|
|
*/
|
|
public final class DefaultVersion extends BaseVersion
|
|
{
|
|
/**
|
|
* @param revision natural number
|
|
* @param channel either alpha, beta or release
|
|
* @param build natural number
|
|
*/
|
|
public DefaultVersion( int revision, Channel channel, int build )
|
|
{
|
|
super( revision, channel, build );
|
|
}
|
|
|
|
@Override
|
|
public boolean isNewerAs( Version maybeOlder )
|
|
{
|
|
if ( this.revision() > maybeOlder.revision() )
|
|
{
|
|
return true;
|
|
}
|
|
|
|
if ( this.channel().compareTo( maybeOlder.channel() ) > 0 )
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return this.build() > maybeOlder.build();
|
|
}
|
|
}
|