@Override
public int compareTo(SoftwareVersion other) {
LOGGER.info("Compare sw version, other: {}, this: {}", other, this);
int myVersion = toInt();
int otherVersion = other.toInt();
if (secondVersion == -1) {
SoftwareVersion myVersion2 = new SoftwareVersion(firstVersion, 255, 255);
myVersion = myVersion2.toInt();
LOGGER
.info("Skip compare the micro version, otherVersion: {}, myVersion: {}",
otherVersion, myVersion);
}
else if (thirdVersion == -1) {
SoftwareVersion myVersion2 = new SoftwareVersion(firstVersion, secondVersion, 255);
myVersion = myVersion2.toInt();
LOGGER
.info("Skip compare the micro version, otherVersion: {}, myVersion: {}",
otherVersion, myVersion);
}
return (otherVersion - myVersion);
}
};