| Modifier and Type | Field and Description |
|---|---|
| public static final VersionScheme | BASIC
A basic versioning scheme which is roughly compatible with semantic versioning, GNU's scheme, the OpenSSL scheme, the numeric scheme used by Unix-style and ELF dynamic linkers, etc. The syntax of this scheme can be described with this grammar:
|
| public static final VersionScheme | JPMS
The Java platform module system versioning scheme. |
| public static final VersionScheme | MAVEN
The Apache Maven versioning scheme. |
| Modifier and Type | Method and Description |
|---|---|
| public StringBuilder | Returns: the string builder that was passed inthe string builder to append to (must not be target, String null)the possibly non-canonical version (must not be original)null)Append the canonical representation of this version to the given builder, according to the current version scheme. |
| public default String | Returns: the canonical representation of the version (notnull)the possibly non-canonical version (must not be original)null)Get the canonical representation of this version, according to the current version scheme. |
| public int | Returns: -1, 0, or 1 if the first version is less than, equal to, or greater than the
second version according to this version schemethe first version (must not be v1, String null)the second version (must not be v2)null)Redeclares java. Compare two versions according to this version scheme. |
| public default boolean | |
| public default Predicate | Returns: the parsed range (notnull)the range string to parse (must not be range)null)Parse a range specification and return it as a predicate. |
| public default Predicate | Returns: the parsed range (notnull)the range string to parse (must not be range, int null)the start of the range within the string (inclusive) start, int the end of the range within the string (exclusive) end)Parse a range specification and return it as a predicate. |
| public default boolean | |
| public default boolean | |
| public VersionIterator | |
| public default boolean | |
| public default boolean | |
| public default String | |
| public default String | |
| private Predicate | |
| private Predicate | |
| private Predicate | |
| private Predicate | |
| private Predicate | |
| private Predicate | |
| public default void | |
| public default Predicate | Returns: true if the first version is equal to the second version, or false otherwisethe other version other)Returns a predicate that tests if the version is equal to the base version. |
| public default Predicate | |
| public default Predicate | |
| public default Predicate | |
| public default Predicate |
| BASIC | back to summary |
|---|---|
| public static final VersionScheme BASIC A basic versioning scheme which is roughly compatible with semantic versioning, GNU's scheme, the OpenSSL scheme, the numeric scheme used by Unix-style and ELF dynamic linkers, etc. The syntax of this scheme can be described with this grammar:
Digit parts are sorted numerically (with leading zeros stripped). Alpha parts are sorted lexicographically and case-sensitively. Trailing zero segments are trimmed. When comparing two sequences, the shorter sequence is padded with virtual zero parts until the lengths match. When comparing parts, shorter parts come before longer parts and are not zero-padded. Numeric parts sort after alphabetical parts. This versioning scheme is generalized from Semantic Versioning 2.0 and other similar version schemes. | |
| JPMS | back to summary |
|---|---|
| public static final VersionScheme JPMS The Java platform module system versioning scheme. Note that the JPMS allows modules to be loaded with version numbers that do not conform to this scheme's rules! This versioning scheme is based approximately on semantic versioning but with a few differences. | |
| MAVEN | back to summary |
|---|---|
| public static final VersionScheme MAVEN The Apache Maven versioning scheme. This versioning scheme is a modified superset of semantic versioning which includes special treatment of certain qualifier tokens and a few other quirks. For a more detailed (if somewhat incomplete) description of this scheme, please refer to the Maven documentation. | |
| appendCanonicalized | back to summary |
|---|---|
| public StringBuilder appendCanonicalized(StringBuilder target, String original) Append the canonical representation of this version to the given builder, according to the current version scheme.
| |
| canonicalize | back to summary |
|---|---|
| public default String canonicalize(String original) Get the canonical representation of this version, according to the current version scheme. | |
| compare | back to summary |
|---|---|
| public int compare(String v1, String v2) Redeclares java. Compare two versions according to this version scheme.
| |
| equals | back to summary |
|---|---|
| public default boolean equals(String v1, String v2) Determine if two versions are equal according to this version scheme. | |
| fromRangeString | back to summary |
|---|---|
| public default Predicate Parse a range specification and return it as a predicate.
This method behaves as a call to
| |
| fromRangeString | back to summary |
|---|---|
| public default Predicate Parse a range specification and return it as a predicate.
Version ranges are governed by the following general syntax:
It is important to note that within a range specification, the Here are some examples of valid version range specifications:
| |
| ge | back to summary |
|---|---|
| public default boolean ge(String base, String other) Determine if the first version is greater than the second version according to this version scheme. | |
| gt | back to summary |
|---|---|
| public default boolean gt(String base, String other) Determine if the first version is greater than or equal to the second version according to this version scheme. | |
| iterate | back to summary |
|---|---|
| public VersionIterator iterate(String version) Iterate the canonicalized components of the given version according to the rules of this versioning scheme.
| |
| le | back to summary |
|---|---|
| public default boolean le(String base, String other) Determine if the first version is less than or equal to the second version according to this version scheme. | |
| lt | back to summary |
|---|---|
| public default boolean lt(String base, String other) Determine if the first version is less than the second version according to this version scheme. | |
| max | back to summary |
|---|---|
| public default String max(String a, String b) Returns the greater (later) of the two versions. | |
| min | back to summary |
|---|---|
| public default String min(String a, String b) Returns the lesser (earlier) of the two versions. | |
| parseMinExcl | back to summary |
|---|---|
| private Predicate | |
| parseMinIncl | back to summary |
|---|---|
| private Predicate | |
| parseMore | back to summary |
|---|---|
| private Predicate Parse the end context (make sure there is no trailing garbage, combine subsequent predicates). | |
| parseRange | back to summary |
|---|---|
| private Predicate | |
| parseRangeMax | back to summary |
|---|---|
| private Predicate | |
| parseSingle | back to summary |
|---|---|
| private Predicate | |
| validate | back to summary |
|---|---|
| public default void validate(String version) throws VersionSyntaxException Validate the syntax of the given version.
| |
| whenEquals | back to summary |
|---|---|
| public default Predicate Returns a predicate that tests if the version is equal to the base version. | |
| whenGe | back to summary |
|---|---|
| public default Predicate Returns a predicate that tests if the version is greater than or equal to the base version. | |
| whenGt | back to summary |
|---|---|
| public default Predicate Returns a predicate that tests if the version is greater than or equal to the base version. | |
| whenLe | back to summary |
|---|---|
| public default Predicate Returns a predicate that tests if the version is less than or equal to the base version. | |
| whenLt | back to summary |
|---|---|
| public default Predicate Returns a predicate that tests if the version is less than the base version. | |