Added compareTo method for easier comparison in expasions.

This commit is contained in:
Mitchell Cook 2018-07-16 17:28:23 +10:00
parent 9cc5a9678f
commit efc6a6337b
No known key found for this signature in database
GPG Key ID: 2718F890507BDEAF

View File

@ -20,22 +20,27 @@
*/
package me.clip.placeholderapi.expansion;
public class Version {
public final class Version {
private boolean isSpigot;
private String version;
public Version(String version, boolean isSpigot) {
this.version = version;
this.isSpigot = isSpigot;
}
public String getVersion() {
return version == null ? "unknown" : version;
}
public boolean isSpigot() {
return isSpigot;
}
public boolean compareTo(String version) {
return getVersion().equalsIgnoreCase(version);
}
private boolean isSpigot;
private String version;
public Version(String version, boolean isSpigot) {
this.version = version;
this.isSpigot = isSpigot;
}
public String getVersion() {
return version == null ? "unknown" : version;
}
public boolean isSpigot() {
return isSpigot;
}
}