Class TorVersion
java.lang.Object
org.torproject.metrics.descriptorparser.utils.TorVersion
- All Implemented Interfaces:
Comparable<TorVersion>
Helper class to compare Tor versions.
Based on "How Tor Version Numbers Work", available at https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/version-spec.txt
-
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(TorVersion other) determineVersionStatus(SortedSet<TorVersion> recommendedVersions) Determine the version status of this tor version in the context of the given recommended tor versions.booleaninthashCode()booleanmatchingPrefix(TorVersion other) Return whether prefixes of this version and another version match.static TorVersionReturn a TorVersion instance from the given tor version string that can be compared to other tor version strings, or null if the given string is not a valid tor version.toString()
-
Method Details
-
of
Return a TorVersion instance from the given tor version string that can be compared to other tor version strings, or null if the given string is not a valid tor version. -
compareTo
- Specified by:
compareToin interfaceComparable<TorVersion>
-
equals
-
matchingPrefix
Return whether prefixes of this version and another version match.Two versions A and B have the same prefix if A starts with B, B starts with A, or A and B are the same.
-
hashCode
public int hashCode() -
toString
-
determineVersionStatus
Determine the version status of this tor version in the context of the given recommended tor versions.
-