Quilt Loader 1
Loading...
Searching...
No Matches
org.quiltmc.loader.api.Version Interface Reference

Representation of a version. More...

Inheritance diagram for org.quiltmc.loader.api.Version:
org.quiltmc.loader.api.Version.Raw org.quiltmc.loader.api.Version.Semantic org.quiltmc.loader.impl.metadata.qmj.GenericVersionImpl org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl

Classes

interface  Raw
 A string version, sorted with String#compareTo(String). More...
interface  Semantic
 Representation of a semantic version. More...

Public Member Functions

String raw ()
default boolean isSemantic ()
default Semantic semantic ()
int compareTo (Version other)
 If both this and the given version are semantic versions then this compares with the behaviour of Semantic#compareTo(Semantic).

Static Public Member Functions

static Version of (String raw)

Static Public Attributes

static Comparator< VersionCOMPARATOR = Version::compareTo
 Calls Version#compareTo(Version): this doesn't accept nulls.

Detailed Description

Representation of a version.


All implementations either implement Raw or Semantic.
Unfortunately (due to Version.Semantic already implementing Comparable) this doesn't implement Comparable directly. Instead you can either use compareTo(Version) or COMPARATOR for all your comparing needs.

Member Function Documentation

◆ compareTo()

int org.quiltmc.loader.api.Version.compareTo ( Version other)

If both this and the given version are semantic versions then this compares with the behaviour of Semantic#compareTo(Semantic).


Otherwise both versions are compared with their raw() strings, using the FlexVer comparison scheme

Implemented in org.quiltmc.loader.impl.metadata.qmj.GenericVersionImpl, and org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.

◆ raw()

String org.quiltmc.loader.api.Version.raw ( )
Returns
The raw string that this version was constructed from.

Implemented in org.quiltmc.loader.impl.metadata.qmj.GenericVersionImpl, and org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.


The documentation for this interface was generated from the following file:
  • src/main/java/org/quiltmc/loader/api/Version.java