Reputation: 7940
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() {}
Upvotes: 0
Views: 187
Reputation: 5589
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;
}
}
Upvotes: 3