Package freemarker.template
Class Version
- java.lang.Object
-
- freemarker.template.Version
-
- All Implemented Interfaces:
java.io.Serializable
public final class Version extends java.lang.Object implements java.io.SerializableRepresents a version number plus the further qualifiers and build info. This is mostly used for representing a FreeMarker version number, but should also be able to parse the version strings of 3rd party libraries.- Since:
- 2.3.20
- See Also:
Configuration.getVersion(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Version(int intValue)Creates an object based on theintvalue that uses the same kind of encoding asintValue().Version(int major, int minor, int micro)Version(int major, int minor, int micro, java.lang.String extraInfo, java.lang.Boolean gaeCompatible, java.util.Date buildDate)Version(java.lang.String stringValue)Version(java.lang.String stringValue, java.lang.Boolean gaeCompliant, java.util.Date buildDate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.DategetBuildDate()java.lang.StringgetExtraInfo()The arbitrary string after the micro version number without leading dot, dash or underscore, like "RC03" in "2.4.0-RC03".intgetMajor()The 1st version number, like 1 in "1.2.3".intgetMicro()The 3rd version number, like 3 in "1.2.3".intgetMinor()The 2nd version number, like 2 in "1.2.3".inthashCode()intintValue()static intintValueFor(int major, int minor, int micro)java.lang.BooleanisGAECompliant()java.lang.StringtoString()Contains the major.minor.micor numbers and the extraInfo part, not the other information.
-
-
-
Constructor Detail
-
Version
public Version(java.lang.String stringValue)
- Throws:
java.lang.IllegalArgumentException- if the version string is malformed
-
Version
public Version(java.lang.String stringValue, java.lang.Boolean gaeCompliant, java.util.Date buildDate)- Throws:
java.lang.IllegalArgumentException- if the version string is malformed
-
Version
public Version(int major, int minor, int micro)
-
Version
public Version(int intValue)
Creates an object based on theintvalue that uses the same kind of encoding asintValue().- Since:
- 2.3.24
-
Version
public Version(int major, int minor, int micro, java.lang.String extraInfo, java.lang.Boolean gaeCompatible, java.util.Date buildDate)
-
-
Method Detail
-
intValueFor
public static int intValueFor(int major, int minor, int micro)
-
toString
public java.lang.String toString()
Contains the major.minor.micor numbers and the extraInfo part, not the other information.- Overrides:
toStringin classjava.lang.Object
-
getMajor
public int getMajor()
The 1st version number, like 1 in "1.2.3".
-
getMinor
public int getMinor()
The 2nd version number, like 2 in "1.2.3".
-
getMicro
public int getMicro()
The 3rd version number, like 3 in "1.2.3".
-
getExtraInfo
public java.lang.String getExtraInfo()
The arbitrary string after the micro version number without leading dot, dash or underscore, like "RC03" in "2.4.0-RC03". This is usually a qualifier (RC, SNAPHOST, nightly, beta, etc) and sometimes build info (like date).
-
isGAECompliant
public java.lang.Boolean isGAECompliant()
- Returns:
- The Google App Engine compliance, or
null.
-
getBuildDate
public java.util.Date getBuildDate()
- Returns:
- The build date if known, or
null.
-
intValue
public int intValue()
- Returns:
- major * 1000000 + minor * 1000 + micro.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-