mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
make Boolean, Byte, Short, etc. implement Comparable
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package java.lang;
|
||||
|
||||
public final class Long extends Number {
|
||||
public final class Long extends Number implements Comparable<Long> {
|
||||
public static final Class TYPE = Class.forCanonicalName("J");
|
||||
public static final Long MAX_VALUE = 9223372036854775807l;
|
||||
|
||||
@ -22,6 +22,10 @@ public final class Long extends Number {
|
||||
return new Long(value);
|
||||
}
|
||||
|
||||
public int compareTo(Long o) {
|
||||
return value > o.value ? 1 : (value < o.value ? -1 : 0);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Long && ((Long) o).value == value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user