public class Version
extends java.lang.Object
Constructor and Description |
---|
Version(java.lang.String name,
int major,
int minor)
Creates a new Version object.
|
Version(java.lang.String name,
int major,
int minor,
int micro)
Creates a new Version object.
|
Version(java.lang.String name,
int major,
int minor,
int micro,
boolean beta)
Creates a new Version object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
byte |
getMajorNumber()
Returns the major version number.
|
byte |
getMicroNumber()
Returns the micro version number.
|
byte |
getMinorNumber()
Returns the minor version number.
|
java.lang.String |
getName()
Returns the version name.
|
int |
hashCode() |
boolean |
isBeta()
Indicates whether this version represents a beta state.
|
java.lang.String |
toString() |
static Version |
valueOf(java.lang.String version)
Returns the version object for the given string.
|
public Version(java.lang.String name, int major, int minor)
name
- a product version name, may be null
major
- the major version number.minor
- the minor version number.public Version(java.lang.String name, int major, int minor, int micro)
name
- a product version name, may be null
major
- the major version number.minor
- the minor version number.micro
- the micro version number.public Version(java.lang.String name, int major, int minor, int micro, boolean beta)
name
- a product version name, may be null
major
- the major version number.minor
- the minor version number.micro
- the micro version number.beta
- true
indicates that this is a beta version.public boolean isBeta()
true
if this version represents a beta state.public byte getMajorNumber()
public byte getMicroNumber()
public byte getMinorNumber()
public java.lang.String getName()
null
if no product version name was
specified.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Version valueOf(java.lang.String version)
version
- a string representing version information. The string must consist
of multiple (up to three) positive decimal integers separated by periods
and may contain the character 'b
' instead of the last period
(indicating a beta version). E.g. 1.0
, 1.4.1
,
1.0b5
are valid, 1
, 1b5
,
1.3.3.1
are not.java.lang.IllegalArgumentException
- if version represents no valid version
information.
Submit a bug or feature.
For further information and documentation, visit the official Jalopy website.
This page generated: March 30 2013