Skip to content

Instantly share code, notes, and snippets.

@chris-martin
Created January 17, 2013 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-martin/4560595 to your computer and use it in GitHub Desktop.
Save chris-martin/4560595 to your computer and use it in GitHub Desktop.
trait OrderedByProperty[A <: OrderedByProperty[A]] extends Ordered[A] { a: A =>
protected def orderBy: Ordered[_]
override def compare(that: A): Int = orderBy compareTo that.orderBy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment