co.cask.tigon.utils
Class ProjectInfo.Version

java.lang.Object
  extended by co.cask.tigon.utils.ProjectInfo.Version
All Implemented Interfaces:
Comparable<ProjectInfo.Version>
Enclosing class:
ProjectInfo

public static final class ProjectInfo.Version
extends Object
implements Comparable<ProjectInfo.Version>

This class encapsulates information about project version.


Constructor Summary
ProjectInfo.Version(int major, int minor, int fix, boolean snapshot, long buildTime)
           
ProjectInfo.Version(String version)
          Construct a Version instance by parsing the version string, in the format returned by toString().
 
Method Summary
 int compareTo(ProjectInfo.Version o)
           
 long getBuildTime()
           
 String getBuildVersion()
           
 int getFix()
           
 int getMajor()
           
 int getMinor()
           
 boolean isSnapshot()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProjectInfo.Version

public ProjectInfo.Version(int major,
                           int minor,
                           int fix,
                           boolean snapshot,
                           long buildTime)

ProjectInfo.Version

public ProjectInfo.Version(@Nullable
                           String version)
Construct a Version instance by parsing the version string, in the format returned by toString().

Parameters:
version - The version string. If the version is null, all versions would be 0.
Method Detail

getMajor

public int getMajor()

getMinor

public int getMinor()

getFix

public int getFix()

isSnapshot

public boolean isSnapshot()

getBuildTime

public long getBuildTime()

getBuildVersion

public String getBuildVersion()

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(ProjectInfo.Version o)
Specified by:
compareTo in interface Comparable<ProjectInfo.Version>


Copyright © 2014 Cask Data, Inc. Licensed under the Apache License, Version 2.0.