Quilt Loader 1
Loading...
Searching...
No Matches
net.fabricmc.loader.api.SemanticVersion Interface Reference

Represents a Semantic Version. More...

Inheritance diagram for net.fabricmc.loader.api.SemanticVersion:
net.fabricmc.loader.api.Version net.fabricmc.loader.impl.util.version.SemanticVersionImpl net.fabricmc.loader.util.version.SemanticVersionImpl org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion net.fabricmc.loader.impl.util.version.SemanticVersionImpl net.fabricmc.loader.util.version.SemanticVersionImpl net.fabricmc.loader.impl.util.version.SemanticVersionImpl

Public Member Functions

int getVersionComponentCount ()
 Returns the number of components in this version.
int getVersionComponent (int pos)
 Returns the version component at pos.
Optional< String > getPrereleaseKey ()
 Returns the prerelease key in the version notation.
Optional< String > getBuildKey ()
 Returns the build key in the version notation.
boolean hasWildcard ()
 Returns if a wildcard notation is present in this version.
default int compareTo (SemanticVersion o)
Public Member Functions inherited from net.fabricmc.loader.api.Version
String getFriendlyString ()
 Returns the user-friendly representation of this version.

Static Public Member Functions

static SemanticVersion parse (String s) throws VersionParsingException
 Parses a semantic version from a string notation.

Public Attributes

int COMPONENT_WILDCARD = Integer.MIN_VALUE
 The value of version component that indicates a wildcard.

Detailed Description

Represents a Semantic Version.

Compared to a regular Version, this type of version receives better support for version comparisons in dependency notations, and is preferred.

See also
Version

Member Function Documentation

◆ compareTo()

default int net.fabricmc.loader.api.SemanticVersion.compareTo ( SemanticVersion o)
inline

◆ getBuildKey()

Optional< String > net.fabricmc.loader.api.SemanticVersion.getBuildKey ( )

Returns the build key in the version notation.

The build key is indicated by a + in the version notation.

Returns
the optional build key

Implemented in net.fabricmc.loader.impl.util.version.SemanticVersionImpl, net.fabricmc.loader.util.version.SemanticVersionImpl, and org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion.

◆ getPrereleaseKey()

Optional< String > net.fabricmc.loader.api.SemanticVersion.getPrereleaseKey ( )

Returns the prerelease key in the version notation.

The prerelease key is indicated by a - before a + in the version notation.

Returns
the optional prerelease key

Implemented in net.fabricmc.loader.impl.util.version.SemanticVersionImpl, net.fabricmc.loader.util.version.SemanticVersionImpl, and org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion.

◆ getVersionComponent()

int net.fabricmc.loader.api.SemanticVersion.getVersionComponent ( int pos)

Returns the version component at pos.

May return COMPONENT_WILDCARD to indicate a wildcard component.

If the pos exceeds the number of components, returns COMPONENT_WILDCARD if the version has wildcard; otherwise returns 0.

Parameters
posthe position to check
Returns
the version component

Implemented in net.fabricmc.loader.impl.util.version.SemanticVersionImpl, net.fabricmc.loader.util.version.SemanticVersionImpl, and org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion.

◆ getVersionComponentCount()

int net.fabricmc.loader.api.SemanticVersion.getVersionComponentCount ( )

Returns the number of components in this version.

For example, 1.3.x has 3 components.

Returns
the number of components

Implemented in net.fabricmc.loader.impl.util.version.SemanticVersionImpl, net.fabricmc.loader.util.version.SemanticVersionImpl, and org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion.

◆ hasWildcard()

boolean net.fabricmc.loader.api.SemanticVersion.hasWildcard ( )

Returns if a wildcard notation is present in this version.

A wildcard notation is a x, X, or * in the version string, such as 2.5.*.

Returns
whether this version has a wildcard notation

Implemented in net.fabricmc.loader.impl.util.version.SemanticVersionImpl, net.fabricmc.loader.util.version.SemanticVersionImpl, and org.quiltmc.loader.impl.fabric.util.version.Quilt2FabricSemanticVersion.

◆ parse()

SemanticVersion net.fabricmc.loader.api.SemanticVersion.parse ( String s) throws VersionParsingException
inlinestatic

Parses a semantic version from a string notation.

Parameters
sthe string notation of the version
Returns
the parsed version
Exceptions
VersionParsingExceptionif a problem arises during version parsing

Implements net.fabricmc.loader.api.Version.


The documentation for this interface was generated from the following file:
  • src/fabric/api/java/net/fabricmc/loader/api/SemanticVersion.java