com.alee.managers.plugin.data
Class PluginVersion

java.lang.Object
  extended by com.alee.managers.plugin.data.PluginVersion
All Implemented Interfaces:
java.io.Serializable

public class PluginVersion
extends java.lang.Object
implements java.io.Serializable

Plugin version data class.

Author:
Mikle Garin
See Also:
How to use PluginManager, PluginManager, Serialized Form

Field Summary
static PluginVersion DEFAULT
          Simple default v1.0.0 version.
 
Constructor Summary
PluginVersion()
          Constructs new plugin version data object.
PluginVersion(int major, int minor)
          Constructs new plugin version data object with the specified major and minor version numbers.
PluginVersion(int major, int minor, java.lang.Integer build)
          Constructs new plugin version data object with the specified major and minor version numbers.
 
Method Summary
 java.lang.Integer getBuild()
          Returns plugin build version.
 int getMajor()
          Returns major plugin version.
 int getMinor()
          Returns minor plugin version.
 boolean isNewerThan(PluginVersion ov)
          Returns whether this plugin version is newer than the specified one or not.
 boolean isOlderThan(PluginVersion ov)
          Returns whether this plugin version is older than the specified one or not.
 boolean isSame(PluginVersion ov)
          Returns whether this plugin version is the same as the specified one or not.
 void setBuild(java.lang.Integer build)
          Sets plugin build version.
 void setMajor(int major)
          Sets major plugin version.
 void setMinor(int minor)
          Sets minor plugin version
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final PluginVersion DEFAULT
Simple default v1.0.0 version.

Constructor Detail

PluginVersion

public PluginVersion()
Constructs new plugin version data object.


PluginVersion

public PluginVersion(int major,
                     int minor)
Constructs new plugin version data object with the specified major and minor version numbers.

Parameters:
major - major version number
minor - minor version number

PluginVersion

public PluginVersion(int major,
                     int minor,
                     java.lang.Integer build)
Constructs new plugin version data object with the specified major and minor version numbers.

Parameters:
major - major version number
minor - minor version number
build - build version number
Method Detail

getMajor

public int getMajor()
Returns major plugin version.

Returns:
major plugin version

setMajor

public void setMajor(int major)
Sets major plugin version.

Parameters:
major - new major plugin version

getMinor

public int getMinor()
Returns minor plugin version.

Returns:
minor plugin version

setMinor

public void setMinor(int minor)
Sets minor plugin version

Parameters:
minor - new minor plugin version

getBuild

public java.lang.Integer getBuild()
Returns plugin build version. Might return null in case build is not specified.

Returns:
plugin build version

setBuild

public void setBuild(java.lang.Integer build)
Sets plugin build version. You might want to set it to null in case you don't need build number.

Parameters:
build - plugin build version

isNewerThan

public boolean isNewerThan(PluginVersion ov)
Returns whether this plugin version is newer than the specified one or not.

Parameters:
ov - other plugin version
Returns:
true if this plugin version is newer than the specified one, false otherwise

isOlderThan

public boolean isOlderThan(PluginVersion ov)
Returns whether this plugin version is older than the specified one or not.

Parameters:
ov - other plugin version
Returns:
true if this plugin version is older than the specified one, false otherwise

isSame

public boolean isSame(PluginVersion ov)
Returns whether this plugin version is the same as the specified one or not.

Parameters:
ov - other plugin version
Returns:
true if this plugin version is the same as the specified one, false otherwise

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object