2015-10-05 16:10:44 +02:00
|
|
|
/*
|
|
|
|
* This file is part of Applied Energistics 2.
|
|
|
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
|
|
*/
|
|
|
|
|
2015-03-09 17:35:19 +01:00
|
|
|
package appeng.services.version;
|
|
|
|
|
|
|
|
|
2015-10-05 16:10:44 +02:00
|
|
|
import javax.annotation.Nonnegative;
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
|
|
|
|
|
2015-03-09 17:35:19 +01:00
|
|
|
/**
|
|
|
|
* AE prints version like rv2-beta-8
|
|
|
|
* GitHub prints version like rv2.beta.8
|
|
|
|
*/
|
|
|
|
public final class DefaultVersion extends BaseVersion
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param revision natural number
|
2015-10-05 16:10:44 +02:00
|
|
|
* @param channel either alpha, beta or release
|
|
|
|
* @param build natural number
|
2015-03-09 17:35:19 +01:00
|
|
|
*/
|
2015-10-05 16:10:44 +02:00
|
|
|
public DefaultVersion( @Nonnegative final int revision, @Nonnull final Channel channel, @Nonnegative final int build )
|
2015-03-09 17:35:19 +01:00
|
|
|
{
|
|
|
|
super( revision, channel, build );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean isNewerAs( final Version maybeOlder )
|
2015-03-09 17:35:19 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.revision() > maybeOlder.revision() )
|
2015-03-09 17:35:19 +01:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.channel().compareTo( maybeOlder.channel() ) > 0 )
|
2015-03-09 17:35:19 +01:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.build() > maybeOlder.build();
|
|
|
|
}
|
|
|
|
}
|