public final class Version extends Object
Module at the source level.
Implements value semantics. Instances are immutable.
Implements hashCode() and equals(java.lang.Object) so that instances can be used as
Map keys.
ScmPlugin to interpret
Version's in a way that can be handled by the SCM. For example a Version such
as D/develop-my-project could be mapped to refs/heads/develop-my-project for
Git and branches/develop-my-project for Subversion.| Constructor and Description |
|---|
Version(String stringVersion)
Constructor using a Version literal.
|
Version(VersionType versionType,
String version)
Constructor using the individual fields.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
ArtifactVersion |
getCorrespondingArtifactVersion()
Returns an
ArtifactVersion corresponding to this Version assuming a
direct equivalence between the two. |
String |
getVersion() |
VersionType |
getVersionType() |
int |
hashCode() |
static Version |
parse(String stringVersion)
Parses a Version literal.
|
String |
toString() |
public Version(VersionType versionType, String version)
versionType - VersionType.version - String part of the Version.public Version(String stringVersion)
Throws RuntimeException if parsing fails.
stringVersion - Version literal.public static Version parse(String stringVersion) throws ParseException
stringVersion - Version literal.ParseException - If parsing fails.public VersionType getVersionType()
public String getVersion()
VersionType
information.public ArtifactVersion getCorrespondingArtifactVersion()
ArtifactVersion corresponding to this Version assuming a
direct equivalence between the two.
Note that the mapping between Version and ArtifactVersion during tool
execution is generally handled by ArtifactVersionMapperPlugin. This
method implements a very simple mapping which is only one possible mapping.
ArtifactVersionMapperPlugin must generally be used so that module-specific
mapping algorithms can be honored.
Copyright © 2015–2017 AZYVA INC.. All rights reserved.