public class TorVersion extends java.lang.Object implements java.lang.Comparable<TorVersion>
Based on "How Tor Version Numbers Work", available at https://gitweb.torproject.org/torspec.git/tree/version-spec.txt
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TorVersion other) |
TorVersionStatus |
determineVersionStatus(java.util.SortedSet<TorVersion> recommendedVersions)
Determine the version status of this tor version in the context of the
given recommended tor versions.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
matchingPrefix(TorVersion other)
Return whether prefixes of this version and another version match.
|
static TorVersion |
of(java.lang.String versionString)
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.
|
java.lang.String |
toString() |
public static TorVersion of(java.lang.String versionString)
public int compareTo(TorVersion other)
compareTo
in interface java.lang.Comparable<TorVersion>
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean matchingPrefix(TorVersion other)
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.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public TorVersionStatus determineVersionStatus(java.util.SortedSet<TorVersion> recommendedVersions)