1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 19:36:50 +01:00

added util method to Version

This commit is contained in:
Daniel Dakhno 2021-12-26 17:58:47 +01:00
parent cab9ab714a
commit e889796671

View File

@ -35,6 +35,26 @@ public class Version implements Comparable<Version> {
this.version = version;
}
public boolean smallerOrEqualThan(Version that){
return !greaterThan(that);
}
public boolean greaterOrEqualThan(Version that){
return !smallerThan(that);
}
public boolean smallerThan(Version that){
return compareTo(that) == -1;
}
public boolean greaterThan(Version that){
return compareTo(that) == 1;
}
public boolean sameAs(Version that){
return compareTo(that) == 0;
}
@Override public int compareTo(Version that) {
if(that == null)
return 1;