Added a nice toString to IntegerArgumentType

This commit is contained in:
Nathan Adams
2014-09-25 13:25:29 +02:00
parent fb92c2f3c8
commit f91bc15e19
2 changed files with 20 additions and 0 deletions
@@ -67,4 +67,15 @@ public class IntegerArgumentType implements CommandArgumentType<Integer> {
public int hashCode() {
return 31 * minimum + maximum;
}
@Override
public String toString() {
if (minimum == Integer.MIN_VALUE && maximum == Integer.MAX_VALUE) {
return "integer()";
} else if (maximum == Integer.MAX_VALUE) {
return "integer(" + minimum + ")";
} else {
return "integer(" + minimum + ", " + maximum + ")";
}
}
}