public final class ModuleVersion extends Object
Version of a Module. Includes a
NodePath (which cannot not be partial) and a Version.
Implements value semantics. Instances are immutable.
Implements hashCode() and equals(java.lang.Object) so that instances can be used as
Map keys.
ModuleVersion support the literal form <NodePath>:<Version> where <NodePath> is the NodePath in String format and <Version> is the Version in literal form.
Example: Acme/module:D/master
| Constructor and Description |
|---|
ModuleVersion(NodePath nodePath)
|
ModuleVersion(NodePath nodePath,
Version version)
Constructor using the individual fields.
|
ModuleVersion(String stringModuleVersion)
Constructor using a ModuleVersion literal.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
NodePath |
getNodePath() |
Version |
getVersion()
Returns the
Version. |
int |
hashCode() |
static ModuleVersion |
parse(String stringModuleVersion)
Parses a ModuleVersion literal.
|
String |
toString() |
public ModuleVersion(NodePath nodePath, Version version)
nodePath - NodePath. Cannot be partial.version - Version. Can be null to represent the default Version of a
Module, or simply not include a Version.public ModuleVersion(NodePath nodePath)
NodePath, with a null Version.
Such a ModuleVersion is incomplete. It can be used in
WorkspaceDirUserModuleVersion and
WorkspacePlugin.getSetWorkspaceDir(java.lang.Class<? extends org.azyva.dragom.execcontext.plugin.WorkspaceDir>) to get all workspace directories for
a given Module.
Note that such a ModuleVersion is a special case and cannot be parsed from a literal.
nodePath - NodePath. Cannot be partial.public ModuleVersion(String stringModuleVersion)
Throws RuntimeException if parsing fails.
stringModuleVersion - ModuleVersion literal.public static ModuleVersion parse(String stringModuleVersion) throws ParseException
stringModuleVersion - Version literal.ParseException - If parsing fails.public NodePath getNodePath()
public Version getVersion()
Version.
Can be null in some cases to represent the default Version of a Module as
defined by the ScmPlugin.
public String toString()
Copyright © 2015–2017 AZYVA INC.. All rights reserved.