at.spardat.xma.boot.antext
Class GenPreloadFile.Version

java.lang.Object
  extended byat.spardat.xma.boot.antext.GenPreloadFile.Version
Enclosing class:
GenPreloadFile

public static class GenPreloadFile.Version
extends java.lang.Object

Represents a version number. In contrast to at.spardat.xma.boot.cache.VersionNumber it supports wildcards (e.g. 1.8.* or 1.*.*). Therfore it has its on compareTo-method which treats '*' as equal to any digit.


Constructor Summary
GenPreloadFile.Version(java.lang.String version, boolean strict)
          Constructs a Version by parsing it form a String.
GenPreloadFile.Version(java.lang.String major, java.lang.String minor, java.lang.String bugfix)
          Constructs a Version from major,minor,bugfix.
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this Version to an other Version.
 java.lang.String toString()
          Returns the string representation of this Version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenPreloadFile.Version

public GenPreloadFile.Version(java.lang.String major,
                              java.lang.String minor,
                              java.lang.String bugfix)
Constructs a Version from major,minor,bugfix. All three strings must contain a valid integer. Wildcards are not supported with this constructor.

Throws:
java.lang.NumberFormatException - if any parameter does not contain a parsable integer.

GenPreloadFile.Version

public GenPreloadFile.Version(java.lang.String version,
                              boolean strict)
Constructs a Version by parsing it form a String. The string has to be of the format .. e.g. "1.8.4".

Parameters:
version - the String to parse.
strict - if true no wildcards are allowed. If false '*' can be used as wildcard for any of the three digits.
Throws:
java.lang.IllegalArgumentException - if the string cannot be parsed sucessfully.
Method Detail

compareTo

public int compareTo(java.lang.Object other)
Compares this Version to an other Version. Both Versions may contain wildcards. A Wildcard is considered equal to any corresponding digit. E.g 1.8.5 and 1.8.* are considered equal.

Returns:
-1 if this is less than other 0 if this is equal to other 1 if this is greater than other

toString

public java.lang.String toString()
Returns the string representation of this Version.