Class Version

  • All Implemented Interfaces:
    Serializable, Comparable<Version>

    public class Version
    extends Object
    implements Comparable<Version>, Serializable
    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:
    Serialized Form
    • Constructor Detail

      • Version

        @Deprecated
        public Version​(int major,
                       int minor,
                       int patchLevel,
                       String snapshotInfo)
        Deprecated.
        Use variant that takes group and artifact ids
        Since:
        2.1
      • Version

        public Version​(int major,
                       int minor,
                       int patchLevel,
                       String snapshotInfo,
                       String groupId,
                       String artifactId)
    • Method Detail

      • unknownVersion

        public static Version unknownVersion()
        Method returns canonical "not known" version, which is used as version in cases where actual version information is not known (instead of null).
      • isUnknownVersion

        public boolean isUnknownVersion()
        Since:
        2.7 to replace misspelled isUknownVersion()
      • isSnapshot

        public boolean isSnapshot()
      • getMajorVersion

        public int getMajorVersion()
      • getMinorVersion

        public int getMinorVersion()
      • getPatchLevel

        public int getPatchLevel()
      • getGroupId

        public String getGroupId()
      • getArtifactId

        public String getArtifactId()
      • toFullString

        public String toFullString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object