Top Description Fields Constructors Methods
org.apache.tools.ant.types

public Class ModuleVersion

extends Object
Class Inheritance
Imports
java.util.Objects

Element describing the parts of a Java module version. The version number is required; all other parts are optional.
Since
1.10.6

Field Summary

Modifier and TypeField and Description
private String
build

Module version's optional build version.

private String
number

Module version's required version number.

private String
preRelease

Module version's optional pre-release version.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

build value, or null
getBuild
()

Returns this element's build version, if set.

public String

Returns:

version number
getNumber
()

Returns this element's version number.

public String

Returns:

pre-release value, or null
getPreRelease
()

Returns this element's pre-release version, if set.

public void
setBuild(final String
build version, or null
build
)

Sets this element's build version.

public void
setNumber(final String
version number
number
)

Sets this element's required version number.

public void
setPreRelease(final String
pre-release version, or null
pre
)

Sets this element's pre-release version.

public String

Returns:

Java module version string built from this object's properties
toModuleVersionString
()

Snapshots this element's state and converts it to a string compliant with ModuleDescriptor.Version.

public String

Returns:

string form of this instance
toString
()

Overrides java.lang.Object.toString.

Returns a summary of this object's state, suitable for debugging.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

buildback to summary
private String build

Module version's optional build version.

numberback to summary
private String number

Module version's required version number.

preReleaseback to summary
private String preRelease

Module version's optional pre-release version.

Constructor Detail

ModuleVersionback to summary
public ModuleVersion()

Method Detail

getBuildback to summary
public String getBuild()

Returns this element's build version, if set.

Returns:String

build value, or null

getNumberback to summary
public String getNumber()

Returns this element's version number.

Returns:String

version number

getPreReleaseback to summary
public String getPreRelease()

Returns this element's pre-release version, if set.

Returns:String

pre-release value, or null

setBuildback to summary
public void setBuild(final String build)

Sets this element's build version. This can be any value, including null.

Parameters
build:String

build version, or null

setNumberback to summary
public void setNumber(final String number)

Sets this element's required version number. This cannot contain an ASCII hyphen (-) or plus (+), as those characters are used as delimiters in a complete module version string.

Parameters
number:String

version number

Exceptions
NullPointerException:
if argument is null
IllegalArgumentException:
if argument contains '-' or '+'
setPreReleaseback to summary
public void setPreRelease(final String pre)

Sets this element's pre-release version. This can be any value which doesn't contain an ASCII plus (+).

Parameters
pre:String

pre-release version, or null

Exceptions
IllegalArgumentException:
if argument contains "+"
toModuleVersionStringback to summary
public String toModuleVersionString()

Snapshots this element's state and converts it to a string compliant with ModuleDescriptor.Version.

Returns:String

Java module version string built from this object's properties

Exceptions
IllegalStateException:
if number is null
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a summary of this object's state, suitable for debugging.

Returns:String

string form of this instance

Annotations
@Override