java.lang.Object
tools.jackson.core.Version
- All Implemented Interfaces:
Serializable,Comparable<Version>
Object that encapsulates versioning information of a component.
Version information includes not just version number but also
optionally group and artifact ids of the component being versioned.
Note that optional group and artifact id properties are new with Jackson 2.0: if provided, they should align with Maven artifact information.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
_majorVersion
protected final int _majorVersion -
_minorVersion
protected final int _minorVersion -
_patchLevel
protected final int _patchLevel -
_groupId
-
_artifactId
-
_snapshotInfo
Additional information for snapshot versions; null for non-snapshot (release) versions.
-
-
Constructor Details
-
Version
public Version(int major, int minor, int patchLevel, String snapshotInfo, String groupId, String artifactId) - Parameters:
major- Major version numberminor- Minor version numberpatchLevel- patch level of versionsnapshotInfo- Optional additional string qualifiergroupId- Maven group idartifactId- Maven artifact id
-
-
Method Details
-
unknownVersion
Method returns canonical "not known" version, which is used as version in cases where actual version information is not known (instead of null).- Returns:
- Version instance to use as a placeholder when actual version is not known (or not relevant)
-
isUnknownVersion
public boolean isUnknownVersion()- Returns:
Trueif this instance is the one returned by call tounknownVersion()
-
isSnapshot
public boolean isSnapshot() -
getMajorVersion
public int getMajorVersion() -
getMinorVersion
public int getMinorVersion() -
getPatchLevel
public int getPatchLevel() -
getGroupId
-
getArtifactId
-
toFullString
-
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-