|
Quilt Loader 1
|
Representation of a semantic version. More...
Public Member Functions | |
| int | versionComponentCount () |
| Returns the number of components in this version. | |
| int | versionComponent (int index) |
Returns the version component at pos. | |
| int[] | versionComponents () |
| default int | major () |
| Must be a positive integer. | |
| default int | minor () |
| Must be a positive integer. | |
| default int | patch () |
| Must be a positive integer. | |
| String | preRelease () |
| Returns an empty string if not applicable. | |
| default boolean | isPreReleasePresent () |
| String | buildMetadata () |
| Returns an empty string if not applicable. | |
| int | compareTo (Version.Semantic o) |
| Public Member Functions inherited from org.quiltmc.loader.api.Version | |
| 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 Semantic | of (String raw) throws VersionFormatException |
| static Semantic | of (int major, int minor, int patch, String preRelease, String buildMetadata) throws VersionFormatException |
| static Semantic | of (int[] components, @Nullable String preRelease, @Nullable String buildMetadata) throws VersionFormatException |
Static Public Attributes | |
| static final String | EMPTY_BUT_PRESENT_PRERELEASE = new String() |
A special value that represents a preRelease() which is both empty but still present - for example "1.18.0-" (as opposed to "1.18.0", which uses the normal empty string for it's prerelease, due to the missing dash"). | |
| Static Public Attributes inherited from org.quiltmc.loader.api.Version | |
| static Comparator< Version > | COMPARATOR = Version::compareTo |
Calls Version#compareTo(Version): this doesn't accept nulls. | |
Representation of a semantic version.
| String org.quiltmc.loader.api.Version.Semantic.buildMetadata | ( | ) |
Returns an empty string if not applicable.
Implemented in org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.
|
inline |
preRelease() field is present in this version. This is used to differentiate versions with a dash at the end of them (like "1.18.0-", which would return true here), from "1.18.0" (which would return false here.
|
inlinestatic |
Implements org.quiltmc.loader.api.Version.
| String org.quiltmc.loader.api.Version.Semantic.preRelease | ( | ) |
Returns an empty string if not applicable.
Implemented in org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.
| int org.quiltmc.loader.api.Version.Semantic.versionComponent | ( | int | index | ) |
Returns the version component at pos.
If pos is greater than or equal to the number of components, then it returns 0.
| pos | the position to check |
Implemented in org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.
| int org.quiltmc.loader.api.Version.Semantic.versionComponentCount | ( | ) |
Returns the number of components in this version.
For example, 1.3.x has 3 components.
Implemented in org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.
| int[] org.quiltmc.loader.api.Version.Semantic.versionComponents | ( | ) |
Implemented in org.quiltmc.loader.impl.metadata.qmj.SemanticVersionImpl.
|
static |
A special value that represents a preRelease() which is both empty but still present - for example "1.18.0-" (as opposed to "1.18.0", which uses the normal empty string for it's prerelease, due to the missing dash").
You can either compare this to preRelease() using identity to check, or use isPreReleasePresent().
This field exists solely to keep backwards compatibility, since we can't make preRelease() return an Optional.