java.lang.Object
org.apache.maven.shared.release.versions.Version
All Implemented Interfaces:
Cloneable, Comparable<Version>

public class Version extends Object implements Comparable<Version>, Cloneable
  • Field Details

    • aetherVersion

      private final AetherVersion aetherVersion
    • mavenArtifactVersion

      private final MavenArtifactVersion mavenArtifactVersion
    • strVersion

      private final String strVersion
    • digits

      private final List<String> digits
    • annotation

      private String annotation
    • annotationRevision

      private String annotationRevision
    • buildSpecifier

      private final String buildSpecifier
    • annotationSeparator

      private String annotationSeparator
    • annotationRevSeparator

      private String annotationRevSeparator
    • buildSeparator

      private String buildSeparator
    • DIGITS_INDEX

      private static final int DIGITS_INDEX
      See Also:
    • ANNOTATION_SEPARATOR_INDEX

      private static final int ANNOTATION_SEPARATOR_INDEX
      See Also:
    • ANNOTATION_INDEX

      private static final int ANNOTATION_INDEX
      See Also:
    • ANNOTATION_REV_SEPARATOR_INDEX

      private static final int ANNOTATION_REV_SEPARATOR_INDEX
      See Also:
    • ANNOTATION_REVISION_INDEX

      private static final int ANNOTATION_REVISION_INDEX
      See Also:
    • BUILD_SEPARATOR_INDEX

      private static final int BUILD_SEPARATOR_INDEX
      See Also:
    • BUILD_SPECIFIER_INDEX

      private static final int BUILD_SPECIFIER_INDEX
      See Also:
    • SNAPSHOT_IDENTIFIER

      private static final String SNAPSHOT_IDENTIFIER
      See Also:
    • DIGIT_SEPARATOR_STRING

      private static final String DIGIT_SEPARATOR_STRING
      See Also:
    • DEFAULT_ANNOTATION_REV_SEPARATOR

      private static final String DEFAULT_ANNOTATION_REV_SEPARATOR
      See Also:
    • DEFAULT_BUILD_SEPARATOR

      private static final String DEFAULT_BUILD_SEPARATOR
      See Also:
    • STANDARD_PATTERN

      public static final Pattern STANDARD_PATTERN
    • ALTERNATE_PATTERN

      public static final Pattern ALTERNATE_PATTERN
  • Constructor Details

  • Method Details

    • isSnapshot

      public boolean isSnapshot()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getVersionString

      protected static String getVersionString(Version info, String buildSpecifier, String buildSeparator)
    • joinDigitString

      protected static String joinDigitString(List<String> digits)
      Simply joins the items in the list with "." period
      Parameters:
      digits -
    • parseDigits

      private List<String> parseDigits(String strDigits)
      Splits the string on "." and returns a list containing each digit.
      Parameters:
      strDigits -
    • nullIfEmpty

      private static String nullIfEmpty(String s)
    • getDigits

      public List<String> getDigits()
    • getAnnotation

      public String getAnnotation()
    • getAnnotationRevSeparator

      public String getAnnotationRevSeparator()
    • getAnnotationRevision

      public String getAnnotationRevision()
    • getBuildSeparator

      public String getBuildSeparator()
    • getBuildSpecifier

      public String getBuildSpecifier()
    • setDigits

      public Version setDigits(List<String> newDigits)
      Parameters:
      newDigits - the new list of digits
      Returns:
      a new instance of Version
    • setAnnotationRevision

      public Version setAnnotationRevision(String newAnnotationRevision)
      Parameters:
      newAnnotationRevision - the new annotation revision
      Returns:
      a new instance of Version
    • setBuildSpecifier

      public Version setBuildSpecifier(String newBuildSpecifier)
      Parameters:
      newBuildSpecifier - the new build specifier
      Returns:
      a new instance of Version
    • compareTo

      public int compareTo(Version other) throws VersionComparisonConflictException
      Specified by:
      compareTo in interface Comparable<Version>
      Throws:
      VersionComparisonConflictException - if Version and ArtifactVersion give different results