Package com.yubico.yubikit.core
Class Version
- java.lang.Object
-
- com.yubico.yubikit.core.Version
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Version other)booleanequals(java.lang.Object o)static VersionfromBytes(byte[] bytes)Parses a Version from a byte array by taking the first three bytes.byte[]getBytes()Returns the version components as a byte array of size 3.inthashCode()booleanisAtLeast(int major, int minor, int micro)Returns whether or not the Version is greater than or equal to a given version.booleanisLessThan(int major, int minor, int micro)Returns whether or not the Version is less than a given version.static Versionparse(java.lang.String versionString)Parses a Version from a String (eg.java.lang.StringtoString()
-
-
-
Method Detail
-
getBytes
public byte[] getBytes()
Returns the version components as a byte array of size 3.
-
compareTo
public int compareTo(Version other)
- Specified by:
compareToin interfacejava.lang.Comparable<Version>
-
isLessThan
public boolean isLessThan(int major, int minor, int micro)Returns whether or not the Version is less than a given version.
-
isAtLeast
public boolean isAtLeast(int major, int minor, int micro)Returns whether or not the Version is greater than or equal to a given version.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fromBytes
public static Version fromBytes(byte[] bytes)
Parses a Version from a byte array by taking the first three bytes.Additional bytes in the array are ignored.
-
parse
public static Version parse(java.lang.String versionString)
Parses a Version from a String (eg. "Firmware version 5.2.1")- Parameters:
versionString- string that contains a 3-part version, separated by dots.
-
-