I have a following function which requires T to extend Comparable. scala.Long is not comparable as it is representing Java's primitive version.
public static <T extends Comparable<? super T>> Combine<T> ordering() {}
You could wrap your scala.Long in a Comparable wrapper, and use that class:
public static class ScalaLongWrapper implements Comparable<scala.Long>{
public scala.Long v;
public ScalaLongWrapper(scala.Long l){
this.v = l;
}
public int compareTo(scala.Long l){
return this.v - l;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.