Skip to content

Instantly share code, notes, and snippets.

@jarrodhroberson
Created June 19, 2018 15:04
Show Gist options
  • Save jarrodhroberson/6c740ad2f7aad6868ef6c66a48c3ce60 to your computer and use it in GitHub Desktop.
Save jarrodhroberson/6c740ad2f7aad6868ef6c66a48c3ce60 to your computer and use it in GitHub Desktop.
public static final Ordering<SubCategory> NATURAL_ORDER;
static
{
NATURAL_ORDER = new Ordering<SubCategory>() {
@Override
public int compare(@Nullable final SubCategory left, @Nullable final SubCategory right)
{
return ComparisonChain.start()
.compare(checkNotNull(left).categoryId, checkNotNull(right).categoryId)
.compare(left.subCategoryId, right.subCategoryId)
.result();
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment