mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
added util method to Version
This commit is contained in:
parent
cab9ab714a
commit
e889796671
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user